@concepta/nestjs-jwt v4.0.0-alpha.42
Rockets NestJS JWT
A flexible JWT utilities module for signing and validating tokens.
This module extends/wraps the @nestjs/jwt module.
Project
Overview
The module exports three services: JwtSignService
, JwtIssueService
, and JwtVerifyService
.
The JwtSignService
maintains two separate JwtService
instances from the @nestjs/jwt
module,
one for managing access tokens and one for managing refresh tokens.
Each one can be configured separately at registration time for maximum flexibility.
The JwtIssueService
and JwtVerifyService
use the JwtSignService
internally for generating
and validating tokens.
Installation
yarn add @concepta/nestjs-jwt
Configuration
ENV
Configurations available via environment.
Variable | Type | Default | |
---|---|---|---|
JWT_MODULE_ACCESS_SECRET | <string \| Buffer> | randomUUID() * see note | Access token secret |
JWT_MODULE_ACCESS_EXPIRES_IN | <string \| number> | '1h' | Access token expiration length |
JWT_MODULE_REFRESH_SECRET | <string \| Buffer> | copied from access secret | Refresh token secret |
JWT_MODULE_REFRESH_EXPIRES_IN | <string \| number> | '1y' | Refresh token expiration length |
* For security reasons, a random UUID will only be generated for the default secret when
NODE_ENV !== 'production'
.
Advanced
It is possible to override all services at registration time with a custom service that meets their respective interfaces.
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
4 months ago
5 months ago
5 months ago
5 months ago
6 months ago
7 months ago
6 months ago
6 months ago
7 months ago
8 months ago
8 months ago
9 months ago
7 months ago
9 months ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago