Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Safe password resets with json web tokens - Invalid token when decoding

Open
#776 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript, node.js

Research direction

No source file or test is named. Start by reproducing the password-reset token decoding flow described in the issue with jsonwebtoken 8.5.1, then inspect the reported catch error; done means identifying why the token is rejected and confirming the behavior with a focused reproduction.

Written by the indexing model from the issue text.

Description

Description

I am trying to put in place a safe password resets with json web tokens flow, where the first step of the forgot password flow is:

image

... the user is receiving an email with the reset link, the URL contains two query string parameters (token and email):

image

I believe this encode part is working fine, where I am having problems is in the second step:

image

all 3 previous console logs are printed with the expected data, but this one don't console.log('4. user =================>', user) where the catch error is turning back:

image

Environment

Please provide the following:

  • Version of this library used:
jsonwebtoken: ^8.5.1
Dominant language
JavaScript
Stars
18.2k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from auth0/node-jsonwebtoken

All issues in auth0/node-jsonwebtoken

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.