File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -5,15 +5,16 @@ import { AuthController } from './auth.controller'
5
5
import { JwtModule } from '@nestjs/jwt'
6
6
import { ConfigService } from '@nestjs/config'
7
7
import { JwtStrategy , RefreshJwtStrategy } from './strategies/jwt.strategy'
8
+ import { JWT_VALIDITIES } from '@src/commons/constants'
8
9
9
10
@Module ( {
10
11
imports : [
11
12
JwtModule . registerAsync ( {
12
13
useFactory : async ( config : ConfigService ) => {
13
14
return {
14
- secret : config . get < string > ( 'JWT_ACCESS_TOKEN_SECRET' ) ,
15
+ secret : config . getOrThrow < string > ( 'JWT_ACCESS_TOKEN_SECRET' ) ,
15
16
signOptions : {
16
- expiresIn : config . get < string > ( 'JWT_ACCESS_TOKEN_VALIDITY' ) ,
17
+ expiresIn : JWT_VALIDITIES . accessToken ,
17
18
} ,
18
19
}
19
20
} ,
Original file line number Diff line number Diff line change
1
+ import { access } from 'fs' ;
1
2
import { StringValue } from 'ms'
2
3
3
4
export const SLUG_REGEX = / ^ [ a - z A - Z 0 - 9 \- \_ ] { 1 , 30 } $ /
@@ -9,6 +10,7 @@ export const COOKIES_NAMES = {
9
10
} as const
10
11
11
12
export const JWT_VALIDITIES = {
13
+ accessToken : '15 m' ,
12
14
refreshToken : '30 d' ,
13
15
forgotPassword : '60 m' ,
14
16
emailVerification : '1 d'
You can’t perform that action at this time.
0 commit comments