0

I am using node-jsonwebtoken to manage my authentication workflow. Everything is okay so far, however I need to make the token expires after a predefined amount of inactivity (for e.g. 2 hours). That's mean, if the client didn't make a request using the token in the past 2 hours, for example, the token become invalid and the client need to re-authenticate.

Any suggestion?

Paolo
  • 20,112
  • 21
  • 72
  • 113
John doe
  • 3,680
  • 7
  • 31
  • 65
  • Does this answer your question? [JWT (JSON Web Token) automatic prolongation of expiration](https://stackoverflow.com/questions/26739167/jwt-json-web-token-automatic-prolongation-of-expiration) – O. Jones May 02 '21 at 14:39
  • Why are you using JWT in this case and not just a regular server-backed session? – Joe May 02 '21 at 21:31
  • Yes I think I will switch to a session-based auth. It's the best option for me – John doe May 03 '21 at 04:39

0 Answers0