I am spawning a child process with root privileges in my Electron app for macos. Things are working fine but app is asking for root password on command line instead of user interface.
var cProcess = require('child_process');
var terminal = cProcess.spawn('sudo',['bash']);
terminal.stdin.write('rm /private/var/log/wifi.log');
I want a dialogue box for asking password from user instead. I found cocoasudo that can be helpful and it seems that it can be used with Electron from this thread. But I could not figure out How...
There is another question with similar problem, but it is not helpful in my case. Also a npm package exist but not working.