electron-google-oauth2
electron-google-oauth2 copied to clipboard
Close browser window after sign in
After sign in, the browser window should redirect to the local server and should be closed automatically.
I helped myself by modifying the LoopbackRedirectServer.js file:
if (req.url && url.parse(req.url).pathname === callbackPath) {
// Show message after sign in instead of forwarding to another website
res.end('Google sign in successful. You can close this browser window.')
/*
res.writeHead(302, {
Location: successRedirectURL,
});
res.end();
*/
resolve(url.resolve(`http://127.0.0.1:${port}`, req.url));
this._server.close();
}
While we are on electron there is no necessity on redirecting to other website. So I am creating a pull request to add this feature.