🔧 fix: Properly handle Token Expiry Defaults when Env Variable not set (#7834)

This commit is contained in:
Samuel Path 2025-06-11 20:27:27 +02:00 committed by GitHub
parent 13c7ceb918
commit 6488873bad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View file

@ -409,7 +409,9 @@ const setOpenIDAuthTokens = (tokenset, res) => {
return;
}
const { REFRESH_TOKEN_EXPIRY } = process.env ?? {};
const expiryInMilliseconds = eval(REFRESH_TOKEN_EXPIRY) ?? 1000 * 60 * 60 * 24 * 7; // 7 days default
const expiryInMilliseconds = REFRESH_TOKEN_EXPIRY
? eval(REFRESH_TOKEN_EXPIRY)
: 1000 * 60 * 60 * 24 * 7; // 7 days default
const expirationDate = new Date(Date.now() + expiryInMilliseconds);
if (tokenset == null) {
logger.error('[setOpenIDAuthTokens] No tokenset found in request');