Skip to content

Commit e302885

Browse files
author
Emmanouil Konstantinidis
committed
Fix node-integration option - fixes login
1 parent c608634 commit e302885

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@
9393
},
9494
"devDependencies": {
9595
"babel-eslint": "=4.0.10",
96-
"electron-packager": "=5.0.2",
97-
"electron-prebuilt": "=0.31.0",
96+
"electron-packager": "=5.1.0",
97+
"electron-prebuilt": "=0.32.3",
9898
"eslint": "=1.2.1",
9999
"grunt": "=0.4.5",
100100
"grunt-contrib-clean": "=0.6.0",

src/js/components/login.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,19 @@ var Login = React.createClass({
2727
width: 800,
2828
height: 600,
2929
show: true,
30-
'node-integration': false
30+
'web-preferences': {
31+
'node-integration': false
32+
}
3133
});
3234
var githubUrl = 'https://github.com/login/oauth/authorize?';
3335
var authUrl = githubUrl + 'client_id=' + options.client_id + '&scope=' + options.scope;
3436
authWindow.loadUrl(authUrl);
3537

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

4144
if (code || error) {
4245
// Close the browser if code found or error

0 commit comments

Comments
 (0)