mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-09 12:46:10 -05:00
Add max-age to login cookie for persisting
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { createCookieSessionStorage } from "@remix-run/node";
|
||||
import invariant from "tiny-invariant";
|
||||
|
||||
const ONE_YEAR_IN_SECONDS = 31_536_000;
|
||||
|
||||
invariant(process.env["SESSION_SECRET"]);
|
||||
export const authSessionStorage = createCookieSessionStorage({
|
||||
cookie: {
|
||||
@@ -10,5 +12,6 @@ export const authSessionStorage = createCookieSessionStorage({
|
||||
httpOnly: true,
|
||||
secrets: [process.env["SESSION_SECRET"]],
|
||||
secure: process.env.NODE_ENV === "production",
|
||||
maxAge: ONE_YEAR_IN_SECONDS,
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user