fix(auth): correct local cookie security configuration

This commit is contained in:
Schubert Ferenc 2026-07-11 15:50:15 +02:00
parent b584e60273
commit 155fdbb16a
67 changed files with 1003 additions and 62 deletions

View file

@ -0,0 +1,13 @@
export const AUTH_COOKIE_NAME = process.env.AUTH_COOKIE_NAME ?? "atlas_access_token";
export const AUTH_COOKIE_SECURE = process.env.AUTH_COOKIE_SECURE?.trim().toLowerCase() === "true";
export const AUTH_COOKIE_SAMESITE = (process.env.AUTH_COOKIE_SAMESITE ?? "lax").trim().toLowerCase();
export function buildAuthCookieOptions(maxAge: number) {
return {
httpOnly: true as const,
secure: AUTH_COOKIE_SECURE,
sameSite: AUTH_COOKIE_SAMESITE as "lax" | "strict" | "none",
path: "/" as const,
maxAge
};
}