-
Notifications
You must be signed in to change notification settings - Fork 1
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 check needed. Parsing will throw an error if base64 is not valid #1
base: master
Are you sure you want to change the base?
Conversation
Hey @levinunnink thanks for the PR, your right, thanks for removing the function (i was anyway not happy with this big and complex regex) Could you also remove the |
@michaelzoidl Whoops! I totally missed the test coverage. It should be fixed now. |
Wow, totally forgot this PR. I've seen you published your own version with the name Alternative i could mention your repository in the README of this one. |
@michaelzoidl No worries! I just need to ship this fix into production so I forked it. I'm fine with whatever you want to do. :-) |
We don't actually need to run the regex check on the base64 string.
window.atob
or theBuffer.from
will both throw errors if the string is invalid and theparseJwtToken
will return false.By removing this, we don't get any invalid results on valid jwt tokens.