Skip to content

Commit 3f6c3a8

Browse files
Merge pull request #88 from ekonstantinidis/login-bug
Bug: Authenticate with GitHub
2 parents d5fa3d2 + 1a672c6 commit 3f6c3a8

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"watch-js": "watchify -t babelify src/js/app.js -o build/js/app.js -v",
1010
"watch": "npm run build && grunt build && npm run watch-js & grunt watch",
1111
"start": "electron .",
12-
"dist": "electron-packager . Gitify --overwrite --platform=darwin --arch=x64 --version=0.30.2 --asar=true --icon=images/app-icon.icns --prune --ignore='src' --ignore='coverage'",
12+
"dist": "electron-packager . Gitify --overwrite --platform=darwin --arch=x64 --version=0.31.0 --asar=true --icon=images/app-icon.icns --prune --ignore='src' --ignore='coverage'",
1313
"lint": "eslint 'src/js/' 'src/js/app.js' 'main.js'",
1414
"test": "npm run lint && jest"
1515
},
@@ -92,8 +92,8 @@
9292
},
9393
"devDependencies": {
9494
"babel-eslint": "=4.0.10",
95-
"electron-packager": "=5.0.1",
96-
"electron-prebuilt": "=0.30.2",
95+
"electron-packager": "=5.0.2",
96+
"electron-prebuilt": "=0.31.0",
9797
"eslint": "=1.2.1",
9898
"grunt": "=0.4.5",
9999
"grunt-contrib-clean": "=0.6.0",

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)