fix: last auth provider cookie (wrong domain)

This commit is contained in:
Carl-Gerhard Lindesvärd
2026-02-27 23:41:38 +01:00
parent 1272466235
commit b801d6a8ef
3 changed files with 22 additions and 16 deletions

View File

@@ -7,7 +7,17 @@ export function setSessionTokenCookie(
expiresAt: Date
): void {
setCookie('session', token, {
maxAge: Math.floor((expiresAt.getTime() - new Date().getTime()) / 1000),
maxAge: Math.floor((expiresAt.getTime() - Date.now()) / 1000),
...COOKIE_OPTIONS,
});
}
export function setLastAuthProviderCookie(
setCookie: ISetCookie,
provider: string
): void {
setCookie('last-auth-provider', provider, {
maxAge: 60 * 60 * 24 * 365,
...COOKIE_OPTIONS,
});
}