fix(dropbox-auth): In Electron.
This commit is contained in:
parent
5739e1deaa
commit
55149670da
|
@ -4,5 +4,11 @@
|
|||
"url": "accounts.google.com"
|
||||
},
|
||||
"target": "electron"
|
||||
},
|
||||
"dropbox-auth": {
|
||||
"matchPatterns": {
|
||||
"url": "dropbox.com/oauth2/authorize"
|
||||
},
|
||||
"target": "electron"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,12 +23,10 @@ function authorize(authUrl: string): Promise<string> {
|
|||
return new Promise(resolve => {
|
||||
const popup = window.open(authUrl, windowName);
|
||||
|
||||
gloabalNS.oauthCallbacks[windowName] = () => {
|
||||
const returnURL = popup.location.href;
|
||||
|
||||
gloabalNS.oauthCallbacks[windowName] = url => {
|
||||
popup.close();
|
||||
delete gloabalNS.oauthCallbacks.windowName;
|
||||
resolve(returnURL);
|
||||
resolve(url);
|
||||
};
|
||||
});
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
if (globalNS.oauthCallbacks
|
||||
&& typeof globalNS.oauthCallbacks[windowName]
|
||||
=== 'function') {
|
||||
globalNS.oauthCallbacks[windowName]();
|
||||
globalNS.oauthCallbacks[windowName](window.location.href);
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
|
Loading…
Reference in New Issue