dropbox / dropbox/dropbox-sdk-js
No TOKEN returned and redirect_receiver reference error
- Dominant language
- JavaScript
- Stars
- 970
- Forks
- 353
- Avg merge
- 9h 3m
- Merged PRs (30d)
- 2
Description
**Describe the bug**
If the app is not authorized and the `authenticateWithCordova()` is called the login form is presented in the inappbrowser properly. Filling all credentials and then dropbox tries to redirect to the `https://www.dropbox.com/1/oauth2/redirect_receiver` URI but it crashes with console errors and the dropbox-sdk has not even a chance to catch the `onLoadStop` or `onLoadError` leaving a user with a blank page. The errors in the console are:
```
Uncaught ReferenceError: define is not defined
at redirect_receiver:49
redirect_receiver:81 Uncaught ReferenceError: configureRequire is not defined
at redirect_receiver:81
```
These are exactly the same errors as if you simply open the `https://www.dropbox.com/1/oauth2/redirect_receiver` address in a standalone browser. Of course the `getAuthenticationUrl()` constructs a proper URL like this `https://www.dropbox.com/oauth2/authorize?response_type=token&client_id=CLIENT_D&redirect_uri=https://www.dropbox.com/1/oauth2/redirect_receiver` but the result are the same console errors and no TOKEN is returned
**To Reproduce**
Just try to login get token using the `authenticateWithCordova()`
**Expected Behavior**
A TOKEN should be returned.
**Actual Behavior**
Blank page is displayed and there are console errors in the browser.
**Versions**
* What version of the SDK are you using?
9.0 https://unpkg.com/dropbox@9.0.0/dist/Dropbox-sdk.js
but the same happens with 6.* and 4.*
* Are you using Javascript or Typescript?
JavaScript
* What platform are you using? (if applicable)
Tested on Cordova/Android
Contributor guide
Assessment
This issue has not been assessed yet.