mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-04-09 19:47:54 -05:00
* Kysely initial * Badges initial * Badge routes migrated * Badges migrated * Calendar work * Fix one type problem * Calendar work * findResultsByUserId work * Calendar reworking finished * PlusSuggestions work * Migrated suggestions * Builds progress * Migrated builds * Admin migrated * Migrate articles * User search * Faster getUser * Selectable/insertable as global * Refresh prod db script + patronTier index * identifierToUserId * updateProfile * findByIdentifier * More indexes * User upsert * upsertLite * findAllPlusMembers * updateResultHighlights * updateMany * User finished migration * Fix types * Fix PlusVotingResult typing * PlusVotingRepository WIP * Migrated resultsByMonthYear * Migrated plusVotes (done with db. related migrations) * Plus code to features folder * Fix TODOs * Export * Fix range * Migrate some user pages * Move rest user routes * Move /play * Map list generator * Front page * Move map list generation logic * Move plus voting logic * Info * API * Adjust TODOs * theme * Auth * Remove TODO
22 lines
712 B
TypeScript
22 lines
712 B
TypeScript
import { createCookieSessionStorage } from "@remix-run/node";
|
|
import invariant from "tiny-invariant";
|
|
|
|
const ONE_YEAR_IN_SECONDS = 31_536_000;
|
|
|
|
if (process.env.NODE_ENV === "production") {
|
|
invariant(process.env["SESSION_SECRET"], "SESSION_SECRET is required");
|
|
}
|
|
export const authSessionStorage = createCookieSessionStorage({
|
|
cookie: {
|
|
name: "__session",
|
|
sameSite: "lax",
|
|
// need to specify domain so that sub-domains can access it
|
|
domain: process.env.NODE_ENV === "production" ? "sendou.ink" : undefined,
|
|
path: "/",
|
|
httpOnly: true,
|
|
secrets: [process.env["SESSION_SECRET"] ?? "secret"],
|
|
secure: process.env.NODE_ENV === "production",
|
|
maxAge: ONE_YEAR_IN_SECONDS,
|
|
},
|
|
});
|