From 013b9886af5629b2ead6000b962267afc761c612 Mon Sep 17 00:00:00 2001 From: Elias Schneider Date: Thu, 29 Feb 2024 14:42:05 +0100 Subject: [PATCH] fix: extend access token cookie expiration --- backend/src/auth/auth.service.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/src/auth/auth.service.ts b/backend/src/auth/auth.service.ts index 0be08af1..dbd69b86 100644 --- a/backend/src/auth/auth.service.ts +++ b/backend/src/auth/auth.service.ts @@ -227,13 +227,16 @@ export class AuthService { accessToken?: string, ) { if (accessToken) - response.cookie("access_token", accessToken, { sameSite: "lax" }); + response.cookie("access_token", accessToken, { + sameSite: "lax", + maxAge: 1000 * 60 * 60 * 24 * 30 * 3, // 3 months + }); if (refreshToken) response.cookie("refresh_token", refreshToken, { path: "/api/auth/token", httpOnly: true, sameSite: "strict", - maxAge: 1000 * 60 * 60 * 24 * 30 * 3, + maxAge: 1000 * 60 * 60 * 24 * 30 * 3, // 3 months }); }