From e3d0106d8fa391c8cbaf064fb7827db2dc8b5b8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=B8=D1=82=D0=B0=20=D0=9A=D1=80=D1=83?= =?UTF-8?q?=D0=B3=D0=BB=D0=B8=D1=86=D0=BA=D0=B8=D0=B9?= Date: Mon, 20 Oct 2025 06:44:21 +0600 Subject: [PATCH] =?UTF-8?q?=D0=BA=D1=83=D1=87=D0=B0=20=D0=B3=D0=BE=D0=B2?= =?UTF-8?q?=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/auth/lucia.ts | 5 +++++ server/plugins/auth.ts | 2 ++ 2 files changed, 7 insertions(+) diff --git a/server/auth/lucia.ts b/server/auth/lucia.ts index ad80093..39626aa 100644 --- a/server/auth/lucia.ts +++ b/server/auth/lucia.ts @@ -17,6 +17,11 @@ interface DatabaseUserAttributes { } export const auth = new Lucia(new PrismaAdapter(prisma.session, prisma.user), { + sessionCookie: { + attributes: { + sameSite: 'none', + }, + }, getUserAttributes: ({ id, displayName, username }) => { return { id, diff --git a/server/plugins/auth.ts b/server/plugins/auth.ts index 3cc7cab..7c5bb75 100644 --- a/server/plugins/auth.ts +++ b/server/plugins/auth.ts @@ -24,11 +24,13 @@ export default fp(async (fastify) => { if (session && session.fresh) { const cookie = auth.createSessionCookie(session.id) + reply.setCookie(cookie.name, cookie.value, cookie.attributes) } if (!session) { const blank = auth.createBlankSessionCookie() + reply.setCookie(blank.name, blank.value, blank.attributes) }