куча говна
All checks were successful
Deploy / deploy (push) Successful in 44s

This commit is contained in:
Никита Круглицкий 2025-10-20 06:44:21 +06:00
parent e2068dd89a
commit e3d0106d8f
2 changed files with 7 additions and 0 deletions

View File

@ -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,

View File

@ -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)
}