Cut the Clutter: Test Ignore Files Feature - sign up to become a beta tester here!
Forum Discussion
paevans
4 years agoExplorer | Level 4
How to add force_reapprove to the sdk.js
I'm having trouble with adding the force_reapprove to my code when using the sdk js package. When a user is already logged in I don't want it to skip the process of app consent just in case my user has more than one dropbox account they want to use with my app.
The official Dropbox JavaScript SDK doesn't have the 'force_reapprove' option built in, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.
You should be able to add that to the URL returned by getAuthenticationUrl though. Can you share what you have so far, and what specifically you're having trouble with?
3 Replies
- Greg-DB4 years ago
Dropbox Community Moderator
The official Dropbox JavaScript SDK doesn't have the 'force_reapprove' option built in, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.
You should be able to add that to the URL returned by getAuthenticationUrl though. Can you share what you have so far, and what specifically you're having trouble with?
- paevans4 years agoExplorer | Level 4const dropboxUrl = async () => {const authUrl = await dbx.auth.getAuthenticationUrl(redirectUri,null,'code','legacy',null,'none',false,).then(authUrl => `${authUrl}&force_reapprove=true`);return authUrl;};I took your suggestion and was able to get it working! Thank you for your help!
- Greg-DB4 years ago
Dropbox Community Moderator
I'm glad to hear you were able to get it working already.
For reference though, it's technically safer to parse the URL and set the parameter, instead of just adding it as a string. For instance, you could do something like:
var modifiedAuthUrl = new URL(authUrl); modifiedAuthUrl.searchParams.set('force_reapprove', true); modifiedAuthUrl = modifiedAuthUrl.href;
About Discuss Dropbox Developer & API
Make connections with other developers815 PostsLatest Activity: 22 hours ago
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!