From de1a52f2a741abebfc061d583ea3b76eec9fa937 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Tue, 8 Oct 2024 12:49:47 +0200 Subject: [PATCH] fix: use the default access token expiration time --- apps/preview/server/utils/oAuth2.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/preview/server/utils/oAuth2.ts b/apps/preview/server/utils/oAuth2.ts index 6fcc238df..4fe63e400 100644 --- a/apps/preview/server/utils/oAuth2.ts +++ b/apps/preview/server/utils/oAuth2.ts @@ -23,7 +23,6 @@ declare module 'express-session' { // In seconds export const SESSION_MAX_AGE = 300; -export const ACCESS_TOKEN_EXPIRATION_TIME = 300; const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY || crypto.randomBytes(32).toString('hex'); @@ -250,7 +249,7 @@ export const isAuthenticated = async (req: Request): Promise => { let result = false; let accessToken = getPersistedAccessToken(req); if (accessToken) { - if (!accessToken.expired(ACCESS_TOKEN_EXPIRATION_TIME)) { + if (!accessToken.expired()) { result = true; } else { try {