File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -54,16 +54,18 @@ function authenticateUser() {
5454
5555 contents = authenticationWindow . webContents ;
5656
57- contents . on ( 'did-get-redirect-request ' , ( event , oldUrl , newUrl ) => {
57+ contents . on ( 'did-navigate ' , ( _event , url , httpResponseCode ) => {
5858 const access_tokenStr = 'access_token=' ;
5959 const expires_inStr = '&expires_in' ;
6060 let accessToken ;
6161
62- if ( newUrl . indexOf ( 'access_token=' ) < 0 ) {
62+ if ( url . indexOf ( 'access_token=' ) < 0 ) {
6363 return false ;
6464 }
6565
66- accessToken = newUrl . substring ( newUrl . indexOf ( access_tokenStr ) + 13 , newUrl . indexOf ( expires_inStr ) ) ;
66+ accessToken = url . substring ( url . indexOf ( access_tokenStr ) + 13 , url . indexOf ( expires_inStr ) ) ;
67+
68+ accessToken = accessToken . split ( '&scope=' ) [ 0 ] ;
6769
6870 setUserData ( accessToken ) ;
6971 authenticationWindow . destroy ( ) ;
@@ -93,7 +95,10 @@ function initMainWindow() {
9395 minWidth : 800 ,
9496 minHeight : 640 ,
9597 center : true ,
96- frame : false
98+ frame : false ,
99+ webPreferences : {
100+ nodeIntegration : true
101+ }
97102 } ) ;
98103
99104 mainWindow . loadURL ( `file://${ __dirname } /app/index.html` ) ;
Original file line number Diff line number Diff line change 3131 "babel-preset-react" : " ^6.23.0" ,
3232 "babel-preset-stage-0" : " ^6.22.0" ,
3333 "babel-register" : " ^6.23.0" ,
34- "electron" : " ^1.6.11 " ,
34+ "electron" : " ^6.0.6 " ,
3535 "electron-packager" : " ^8.5.1" ,
3636 "eslint" : " ^4.0.0" ,
3737 "eslint-plugin-react" : " ^7.1.0" ,
You can’t perform that action at this time.
0 commit comments