Compare commits
No commits in common. "master" and "0.2.4" have entirely different histories.
@ -17,11 +17,6 @@ interface DatabaseUserAttributes {
|
||||
}
|
||||
|
||||
export const auth = new Lucia(new PrismaAdapter(prisma.session, prisma.user), {
|
||||
sessionCookie: {
|
||||
attributes: {
|
||||
sameSite: 'none',
|
||||
},
|
||||
},
|
||||
getUserAttributes: ({ id, displayName, username }) => {
|
||||
return {
|
||||
id,
|
||||
|
||||
@ -24,13 +24,11 @@ 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)
|
||||
}
|
||||
|
||||
|
||||
@ -13,13 +13,7 @@ const fastify = Fastify({
|
||||
logger: true,
|
||||
})
|
||||
|
||||
fastify.register(FastifyCors, {
|
||||
origin: [
|
||||
'http://localhost:3000',
|
||||
'http://tauri.localhost',
|
||||
],
|
||||
credentials: true,
|
||||
})
|
||||
fastify.register(FastifyCors)
|
||||
|
||||
fastify.register(FastifyCookie)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user