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

No Support for React Native & Expo #248

Closed
4 tasks done
DeveloperAspire opened this issue Oct 31, 2023 · 2 comments
Closed
4 tasks done

No Support for React Native & Expo #248

DeveloperAspire opened this issue Oct 31, 2023 · 2 comments
Labels
bug This points to a verified bug in the code

Comments

@DeveloperAspire
Copy link

Checklist

  • I have looked into the Readme and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Description

I am trying to decode a jwt token sent from the backend in a React Native expo app and it keeps throwing an error but sure works in a web environment. I expected this to work but it keeps throwing the error "InvalidTokenError: Invalid token specified: invalid base64 for part #2 (Property 'atob' doesn't exist)]"

I have tried all the best I can to solve this. Please help.

Reproduction

  1. Create a react native expo applicatio
  2. Use the package in the react native expo application to decode any jwt token at all.
  3. Print the error to the console.

Additional context

No response

jwt-decode version

4.0.0

Which browsers have you tested in?

Other

@DeveloperAspire DeveloperAspire added the bug This points to a verified bug in the code label Oct 31, 2023
@frederikprijck
Copy link
Member

frederikprijck commented Oct 31, 2023

Duplicate of #241

Long story short, you need to polyfil as of v4 for environments that have no built in support for atob.

Also check #242 and let us know if that works.

Lastly, we reached out to hopefully get this resolved in react native to eventually no longer need any polyfil, see facebook/hermes#1178, be sure to upvote that to show interest in the feature.

@jonkoops
Copy link
Contributor

Since this is a duplicate, shall we close this issue @frederikprijck?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This points to a verified bug in the code
Projects
None yet
Development

No branches or pull requests

3 participants