-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
jwt.verify fails to throw error for expired tokens #370
Comments
I used the following line:
on an expired token and got this result:
On a non-expired token, I got this result:
which is the expected result. Maybe try logging your |
I am using the
I guess putting the |
If wrapping the call to |
@z2oh the |
I hope this help someone. If you use try catch method, you need to put next() in the try. Ex: |
I am creating a jwt like this:
return jwt.sign({ some_key: some_value }, Authentication.secret, { expiresIn: '1s'});
And verifying it like:
jwt.verify(token, Authentication.secret, (err, result) => { if (err) { return res.status(400).send('Failed'); } return next(); }); }
When I log the decoded results, I can see something like:
iat: 1499970792, exp: 1499970793
which looks fine I suppose, I have checked whether the token I am sending to the client is the same as the one I am verifying, all looks good..but the middleware proceeds with next(), am I missing something here?
The text was updated successfully, but these errors were encountered: