Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function createConnection({ clientId, authRedirectUrl, tokens }) {
const accessTokens = tokens || (await api.createAuthWindow(clientId, authRedirectUrl))
const client = new Dropbox({ clientId, accessToken: accessTokens.access_token, fetch })
return { client, accessTokens }
}
function createAuthUrl(clientId, redirectUrl) {
const dbx = new Dropbox({ clientId, fetch })
return dbx.getAuthenticationUrl(redirectUrl)
}