File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -309,7 +309,8 @@ class AuthController {
309309 usrn : user . username ,
310310 bsname : user . businessName ,
311311 rl : roles ,
312- iat : new Date ( ) . getTime ( )
312+ iat : moment ( ) . unix ( ) ,
313+ exp : moment ( ) . add ( ( process . env . TOKEN_LIFETIME || env . TOKEN_LIFETIME || 12 ) , 'hours' ) . unix ( )
313314 } , ( process . env . JWT_SECRET || env . JWT_SECRET ) , {
314315 algorithm : 'HS256'
315316 } ) ;
@@ -328,8 +329,8 @@ class AuthController {
328329 usrn : username ,
329330 bsname : businessName ,
330331 rl : role ,
331- iat : new Date ( ) . getTime ( ) ,
332- exp : new Date ( ) . setDate ( new Date ( ) . getDate ( ) + env . TOKEN_LIFETIME )
332+ iat : moment ( ) . unix ( ) ,
333+ exp : moment ( ) . add ( ( process . env . TOKEN_LIFETIME || env . TOKEN_LIFETIME || 12 ) , 'hours' ) . unix ( )
333334 } , ( process . env . JWT_SECRET || env . JWT_SECRET ) , {
334335 algorithm : 'HS256'
335336 } ) ;
You can’t perform that action at this time.
0 commit comments