File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -44,15 +44,14 @@ const applyConfig = (config) => {
44
44
// - header user is different from token user
45
45
// - token has no expiration
46
46
// - token is expired
47
- console . log ( "USER: " , user ) ;
48
- console . log ( "TOKEN: " , jwtDecode ( token ) ) ;
49
- console . log ( "TOKEN SCADUTO: " , jwtDecode ( token ) . exp < Date . now ( ) / 1000 ) ;
50
- console . log ( "CONDIZIONE: " , ( ( user && jwtDecode ( token ) . sub !== user ) || ! jwtDecode ( token ) . exp || jwtDecode ( token ) . exp < Date . now ( ) / 1000 ) ) ;
51
- if ( ( user && jwtDecode ( token ) . sub !== user ) || ! jwtDecode ( token ) . exp || jwtDecode ( token ) . exp < Date . now ( ) / 1000 ) {
47
+ if (
48
+ ( user && jwtDecode ( token ) . sub !== user ) ||
49
+ ! jwtDecode ( token ) . exp ||
50
+ jwtDecode ( token ) . exp < Date . now ( ) / 1000
51
+ ) {
52
52
// TODO: eventually add base_url to a relative settings.loginUrl
53
53
return res . redirect ( `${ settings . loginUrl } ?came_from=${ req . url } ` ) ;
54
54
}
55
-
56
55
}
57
56
}
58
57
return next ( ) ;
You can’t perform that action at this time.
0 commit comments