mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-06-01 00:13:20 -05:00
Fix theme cookie not saved after session closing
This commit is contained in:
parent
6bacfe9717
commit
b340f32ae3
|
|
@ -4,6 +4,8 @@ import { isTheme } from "./provider";
|
|||
import type { Theme } from "./provider";
|
||||
import invariant from "tiny-invariant";
|
||||
|
||||
const TEN_YEARS_IN_SECONDS = 315_360_000;
|
||||
|
||||
if (process.env.NODE_ENV === "production") {
|
||||
invariant(process.env["SESSION_SECRET"], "SESSION_SECRET is required");
|
||||
}
|
||||
|
|
@ -17,6 +19,7 @@ const themeStorage = createCookieSessionStorage({
|
|||
sameSite: "lax",
|
||||
path: "/",
|
||||
httpOnly: true,
|
||||
maxAge: TEN_YEARS_IN_SECONDS,
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user