summaryrefslogtreecommitdiff
path: root/app/lib/session.server.ts
diff options
context:
space:
mode:
authoryyamashita <yyamashita@hetzner.yyamashita.com>2026-06-19 19:45:41 +0900
committeryyamashita <yyamashita@hetzner.yyamashita.com>2026-06-19 19:45:41 +0900
commitcba06f7e23417a9aef6c15ae26715385feb225ba (patch)
tree042f8e8343e7203ac9c6576e3c18fc6865a59ba1 /app/lib/session.server.ts
parentc6bb8a0c75b4307a73a3e36d97c7b5e69294cfe9 (diff)
Add white theme, post delete, and passkey authentication
- Rewrite CSS to light/white theme - Add delete button (auth-gated) with confirm dialog - Add passkey register/login/logout routes via @simplewebauthn - Gate compose form and delete behind session authentication - Add credentials table to SQLite schema - Add SESSION_SECRET and WebAuthn env vars to docker-compose Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'app/lib/session.server.ts')
-rw-r--r--app/lib/session.server.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/lib/session.server.ts b/app/lib/session.server.ts
new file mode 100644
index 0000000..13a7cd1
--- /dev/null
+++ b/app/lib/session.server.ts
@@ -0,0 +1,12 @@
+import { createCookieSessionStorage } from "react-router";
+
+export const { getSession, commitSession, destroySession } = createCookieSessionStorage({
+ cookie: {
+ name: "__session",
+ secrets: [process.env.SESSION_SECRET ?? "dev-secret-change-in-production"],
+ secure: process.env.NODE_ENV === "production",
+ httpOnly: true,
+ sameSite: "lax",
+ maxAge: 60 * 60 * 24 * 30,
+ },
+});