Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const shell = remoteRequire('shell');
const dropbox = new Client({
key: API_KEY
});
const CLEANUPS = {};
const NOOP = ()=>{};
export default dropbox;
Object.assign(dropbox, new Emitter());
Object.assign(dropbox, Emitter.prototype);
dropbox.authDriver(new AuthDriver.Popup({
receiverUrl: 'https://dropfox.firebaseapp.com/dropbox/oauth_receiver.html'
//receiverUrl: location.href.replace(/[^/]+$/,'') + 'assets/oauth_receiver.html'
}));
export function init(callback=NOOP) {
dropbox.authenticate({ interactive: false }, err => {
if (err) return callback(err);
if (dropbox.isAuthenticated()) {
dropbox.emit('init');
return callback();
}
dropbox.authenticate( err => {
if (err) return callback(err);