StackInTechDev / stackintech-jwt

"stackintech-jwt" is a NestJS open-source project available on GitHub that provides a simple and secure way to implement JSON Web Tokens (JWT) for authentication and authorization in your NestJS applications.
Apache License 2.0
2 stars 0 forks source link

refresh token mechanism #5

Open ghost opened 1 year ago

HassanDev13 commented 1 year ago

Refresh tokens are used to obtain new access tokens when the current access token expires or becomes invalid for some other reason. Refresh tokens have a longer lifespan than access tokens and are used to maintain the user's authenticated session over a longer period of time.

As a best practice, it's recommended to securely store refresh tokens and ensure they are only used when necessary. Refresh tokens should also have a longer expiration time than access tokens, but not be set to never expire. This helps to balance security and convenience.