How to use the dropbox.AuthDriver function in dropbox

To help you get started, we’ve selected a few dropbox examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github keeweb / keeweb / app / scripts / comp / dropbox-link.js View on Github external
receive: function() {
        Dropbox.AuthDriver.Popup.oauthReceiver();
    },
github keeweb / keeweb / app / scripts / comp / dropbox-link.js View on Github external
_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);
        });
    },

dropbox

The Dropbox JavaScript SDK is a lightweight, promise based interface to the Dropbox v2 API that works in both nodejs and browser environments.

MIT
Latest version published 2 years ago

Package Health Score

62 / 100
Full package analysis