fix: cookies should work on all browser

This commit is contained in:
diced
2024-12-16 15:41:25 -08:00
parent 7f7764f1df
commit 57e9790112
2 changed files with 5 additions and 3 deletions

View File

@@ -19,7 +19,7 @@ services:
context: .
dockerfile: Dockerfile
# UNCOMMENT THE BELOW LINE ON THE FIRST RUN!
entrypoint: ['pnpm', 'db:prototype']
# entrypoint: ['pnpm', 'db:prototype']
# entrypoint: ['pnpm', 'prisma', 'migrate', 'reset', '--force']
ports:
- '3000:3000'

View File

@@ -4,14 +4,16 @@ import { User } from '@/lib/db/models/user';
import { randomCharacters } from '@/lib/random';
import { FastifyReply, FastifyRequest } from 'fastify';
import { IncomingMessage, ServerResponse } from 'http';
import { getIronSession } from 'iron-session';
import { getIronSession, type SessionOptions } from 'iron-session';
const cookieOptions = {
const cookieOptions: SessionOptions['cookieOptions'] = {
// week
maxAge: 60 * 60 * 24 * 7,
expires: new Date(Date.now() + 60 * 60 * 24 * 7 * 1000),
path: '/',
sameSite: 'lax',
httpOnly: false,
secure: false,
};
export type ZiplineSession = {