1
0
Fork 0

fix: extend access token cookie expiration

This commit is contained in:
Elias Schneider 2024-02-29 14:42:05 +01:00
parent 43bff91db2
commit 013b9886af
No known key found for this signature in database
GPG Key ID: 07E623B294202B6C
1 changed files with 5 additions and 2 deletions

View File

@ -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
});
}