Compare commits

...

6 Commits

Author SHA1 Message Date
Никита Круглицкий
e3d0106d8f куча говна
All checks were successful
Deploy / deploy (push) Successful in 44s
2025-10-20 06:44:21 +06:00
Никита Круглицкий
e2068dd89a куча говна
All checks were successful
Deploy / deploy (push) Successful in 45s
2025-10-20 06:14:18 +06:00
Никита Круглицкий
a2f845f228 куча говна
All checks were successful
Deploy / deploy (push) Successful in 45s
2025-10-20 06:01:29 +06:00
Никита Круглицкий
1a497d402d куча говна
All checks were successful
Deploy / deploy (push) Successful in 46s
2025-10-20 05:59:06 +06:00
Никита Круглицкий
924bbd4285 куча говна
All checks were successful
Deploy / deploy (push) Successful in 43s
2025-10-20 05:57:08 +06:00
Никита Круглицкий
58d37ee02b куча говна
All checks were successful
Deploy / deploy (push) Successful in 45s
2025-10-20 05:50:27 +06:00
3 changed files with 14 additions and 1 deletions

View File

@ -17,6 +17,11 @@ interface DatabaseUserAttributes {
} }
export const auth = new Lucia(new PrismaAdapter(prisma.session, prisma.user), { export const auth = new Lucia(new PrismaAdapter(prisma.session, prisma.user), {
sessionCookie: {
attributes: {
sameSite: 'none',
},
},
getUserAttributes: ({ id, displayName, username }) => { getUserAttributes: ({ id, displayName, username }) => {
return { return {
id, id,

View File

@ -24,11 +24,13 @@ export default fp(async (fastify) => {
if (session && session.fresh) { if (session && session.fresh) {
const cookie = auth.createSessionCookie(session.id) const cookie = auth.createSessionCookie(session.id)
reply.setCookie(cookie.name, cookie.value, cookie.attributes) reply.setCookie(cookie.name, cookie.value, cookie.attributes)
} }
if (!session) { if (!session) {
const blank = auth.createBlankSessionCookie() const blank = auth.createBlankSessionCookie()
reply.setCookie(blank.name, blank.value, blank.attributes) reply.setCookie(blank.name, blank.value, blank.attributes)
} }

View File

@ -13,7 +13,13 @@ const fastify = Fastify({
logger: true, logger: true,
}) })
fastify.register(FastifyCors) fastify.register(FastifyCors, {
origin: [
'http://localhost:3000',
'http://tauri.localhost',
],
credentials: true,
})
fastify.register(FastifyCookie) fastify.register(FastifyCookie)