From 4731dd690f6be694ab7eac61cb68293c02336be5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa?= Date: Fri, 18 Oct 2024 08:54:12 +0200 Subject: [PATCH] decode iat --- client/src/app/api/auth/[...nextauth]/options.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/src/app/api/auth/[...nextauth]/options.ts b/client/src/app/api/auth/[...nextauth]/options.ts index e5d2a6b..0c72fb0 100644 --- a/client/src/app/api/auth/[...nextauth]/options.ts +++ b/client/src/app/api/auth/[...nextauth]/options.ts @@ -55,7 +55,9 @@ export const authOptions: AuthOptions = { if (sessionToken) { const now = new Date().getTime(); - const exp = decoded.iat ? decoded.iat * 1000 + SESSION_MAX_AGE * 1000 : 0; + const exp = decoded.iat + ? decoded.iat * 1000 + SESSION_MAX_AGE * 1000 + : SESSION_MAX_AGE * 1000; if (now < exp) { return {