Skip to content

Commit 5f0db7c

Browse files
Merge pull request #169 from Sanketika-Obsrv/token_sign_fix
feat: #OBS-I537: updated expiry time for jwt token
2 parents bdca0f8 + 965067b commit 5f0db7c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/middlewares/passportAuthenticate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { logger } from '../../shared/utils/logger';
88

99
const baseURL = appConfig.BASE_URL;
1010
const private_key: string = appConfig.USER_TOKEN_PRIVATE_KEY;
11-
const expiresIn = appConfig.USER_TOKEN_EXPIRY;
11+
const expiresIn = parseInt(appConfig.USER_TOKEN_EXPIRY) || 86400;
1212

1313
const generateToken = (user: User) => {
1414
const payload = _.pick(user, ['id', 'user_name', 'email_address', 'roles', 'is_owner']);

src/shared/resources/appConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,6 @@ export default {
7373
PUBLIC_CLIENT: env.KEYCLOAK_PUBLIC_CLIENT || 'false',
7474
SSL_REQUIRED: env.KEYCLOAK_SSL_REQUIRED || 'external',
7575
},
76-
USER_TOKEN_EXPIRY: env.USER_TOKEN_EXPIRY || '1d',
76+
USER_TOKEN_EXPIRY: env.USER_TOKEN_EXPIRY || '86400',
7777
STORAGE_TYPES: env.STORAGE_TYPES || '{"lake_house":true,"realtime_store":true}'
7878
};

0 commit comments

Comments
 (0)