We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d5fa3d2 commit 79499f1Copy full SHA for 79499f1
src/js/components/login.js
@@ -33,11 +33,10 @@ var Login = React.createClass({
33
var authUrl = githubUrl + 'client_id=' + options.client_id + '&scope=' + options.scope;
34
authWindow.loadUrl(authUrl);
35
36
- authWindow.webContents.on('did-get-redirect-request', function (event, oldUrl, newUrl) {
37
-
38
- var raw_code = /code=([^&]*)/.exec(newUrl) || null;
+ authWindow.webContents.on('will-navigate', function (event, url) {
+ var raw_code = /code=([^&]*)/.exec(url) || null;
39
var code = (raw_code && raw_code.length > 1) ? raw_code[1] : null;
40
- var error = /\?error=(.+)$/.exec(newUrl);
+ var error = /\?error=(.+)$/.exec(url);
41
42
if (code || error) {
43
// Close the browser if code found or error
0 commit comments