Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error thrown when generating Authentication URL for PKCE auth flow in a browser #489

Closed
evtaylor opened this issue Jan 3, 2021 · 2 comments
Labels

Comments

@evtaylor
Copy link

evtaylor commented Jan 3, 2021

Describe the bug
auth.js:138 Uncaught TypeError: crypto.randomBytes is not a function Error occurs when getting authentication url for PCKE auth flow in a browser.

To Reproduce
- See codepen.
- Error appears in console

Expected Behavior
Calling getAuthenticationUrl on DropboxAuth instance for PKCE auth flow should return string authentication url.

Actual Behavior
Error occurs: auth.js:138 Uncaught TypeError: crypto.randomBytes is not a function

Screenshots
image

Versions

  • What version of the SDK are you using?
    • 8.2.0
  • Are you using Javascript or Typescript?
    • Reproducible in both
  • What platform are you using? (if applicable)
    • Chrome Version 87.0.4280.88 (Official Build) (64-bit)
    • Firefox 83.0 (64-bit)
    • Edge Version 87.0.664.66 (Official build) (64-bit)

Additional context
The dropbox sdk appears to call window.crypto.randomBytes() which does not exist according to the MDN docs

@evtaylor evtaylor added the bug label Jan 3, 2021
@greg-db
Copy link
Contributor

greg-db commented Jan 4, 2021

Thanks for the report! We'll look into it.

@greg-db
Copy link
Contributor

greg-db commented Jan 29, 2021

This should be fixed now in v9.0.0. Please refer to the upgrading guide for information on migrating to that. Thanks!

@greg-db greg-db closed this as completed Jan 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants