Skip to content

Conversation

@glensc
Copy link
Contributor

@glensc glensc commented Feb 6, 2023

By submitting a PR to this repository, you agree to the terms within the Auth0 Code of Conduct. Please see the contributing guidelines for how to create and submit a high-quality PR for this repo.

Description

I can not find from jsonwebtoken.decode where it would throw:

but it does return null, which was not checked.

The same goes for jws.decode, it returns null rather than throwing:

Checklist

  • This change adds test coverage for new/changed/fixed functionality
  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not the default branch

@glensc glensc changed the title Fix: jwt.decode does throw, check null instead Fix: jwt.decode doesn't throw, check null instead Feb 6, 2023
@glensc glensc force-pushed the jwt.decode-does-not-throw branch from ef67256 to eac5c3f Compare February 6, 2023 16:44
@glensc glensc force-pushed the jwt.decode-does-not-throw branch from eac5c3f to ca382e9 Compare February 6, 2023 16:44
@glensc
Copy link
Contributor Author

glensc commented Feb 6, 2023

jws.decode has one code path that can throw:

that should be merged first.

@glensc glensc mentioned this pull request Feb 6, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant