Skip to content

Commit 79499f1

Browse files
author
Emmanouil Konstantinidis
committed
Fix bug with login
1 parent d5fa3d2 commit 79499f1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/js/components/login.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,10 @@ var Login = React.createClass({
3333
var authUrl = githubUrl + 'client_id=' + options.client_id + '&scope=' + options.scope;
3434
authWindow.loadUrl(authUrl);
3535

36-
authWindow.webContents.on('did-get-redirect-request', function (event, oldUrl, newUrl) {
37-
38-
var raw_code = /code=([^&]*)/.exec(newUrl) || null;
36+
authWindow.webContents.on('will-navigate', function (event, url) {
37+
var raw_code = /code=([^&]*)/.exec(url) || null;
3938
var code = (raw_code && raw_code.length > 1) ? raw_code[1] : null;
40-
var error = /\?error=(.+)$/.exec(newUrl);
39+
var error = /\?error=(.+)$/.exec(url);
4140

4241
if (code || error) {
4342
// Close the browser if code found or error

0 commit comments

Comments
 (0)