Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
receive: function() {
Dropbox.AuthDriver.Popup.oauthReceiver();
},
_getClient: function(complete, overrideAppKey) {
if (this._dropboxClient && this._dropboxClient.isAuthenticated()) {
complete(null, this._dropboxClient);
return;
}
if (!overrideAppKey && !this.isValidKey()) {
return complete(DropboxCustomErrors.BadKey);
}
const client = new Dropbox.Client({key: overrideAppKey || getKey()});
if (Launcher) {
client.authDriver(new Dropbox.AuthDriver.Electron({ receiverUrl: location.href }));
} else {
client.authDriver(new Dropbox.AuthDriver.Popup({ receiverUrl: location.href }));
}
client.authenticate((error, client) => {
if (!error) {
this._dropboxClient = client;
}
complete(error, client);
});
},