Last Updated: February 25, 2016
·
1.6K
· timgreen

Make Dropbox JS OAuth work with AngularJS

Solution

In order to avoid re-auth each time after refresh, tell AngularJS router to work in html5Mode:

$locationProvider.html5Mode(true);

Reason

Because Dropbox Redirect Driver use url fragment to pass the auth info. Sample backurl looks like

http://localhost/your_app/#access_token=xxxxx...

If AngularJS router is not in html5Mode, it will try to add one '/' after the '#' to make it as

http://localhost/your_app/#/access_token=xxxxx...

1 Response
Add your response

Where does the $locationProvider.html5Mode(true); line go?

over 1 year ago ·