Protected
Readonly
dataProtected
Readonly
idProtected
Readonly
jwtProtected
loggerProtected
Readonly
loggerProtected
Readonly
usersDelete refresh token from database
refresh token id
Delete refresh token from database
user id for which to delete refresh tokens
Protected
generateGenerate new access and refresh tokens for user
token generation options
service method context
Generate new access and refresh tokens
refresh token string
service method context
= user tokens
Check if refresh token is valid
refresh token string
service method context
JwtService is a service that provides functionality for generating, verifying, and refreshing JSON Web Tokens (JWTs) in a NestJS application.
It can be used to generate access and refresh tokens for users and then verify those tokens when they are presented to the application. In addition, the JwtService can refresh an expired access token with a valid refresh token, and it can delete a refresh token from the database when it is no longer needed.
The service uses a secret key to sign and verify the tokens, and it can be configured to expire the tokens after a certain period of time. With JwtService, NestJS applications can implement secure authentication and authorization for users.