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

Catch verification error. #357

Open
uwejan opened this issue Feb 23, 2021 · 3 comments
Open

Catch verification error. #357

uwejan opened this issue Feb 23, 2021 · 3 comments

Comments

@uwejan
Copy link

uwejan commented Feb 23, 2021

Perhaps i miss read, forgive me. but i could not find anything related to how to catch verification error.
i notice jsonwebtoken has this method,

jwt.verify(token, 'shhhhh', function(err, decoded) {
  if (err) {
    /*
      err = {
        name: 'TokenExpiredError',
        message: 'jwt expired',
        expiredAt: 1408621000
      }
    */
  }
});

Purpose make a redis call to invalidate session.
Thanks.

@nelsonic
Copy link
Member

nelsonic commented Mar 8, 2021

@uwejan if you can give us a bit more context/detail we might be able to help. Thanks.

@uwejan
Copy link
Author

uwejan commented Mar 8, 2021

Hi, Thanks for looking at this.
What i mean, is the same way how we have the verify method to invoke our own verification and return isValid:true.
in case the token expired, i want to delete a session that i created on the verify method. so maybe token expired custom method like verify method to give more flexibility.

@nayabatir1
Copy link

@nelsonic may I help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants