brutalism design
This commit is contained in:
@@ -33,13 +33,12 @@ const plugin: FastifyPluginAsyncTypebox = async (fastify) => {
|
||||
},
|
||||
})
|
||||
|
||||
const session = await fastify.lucia.createSession(user.id, {})
|
||||
const session = await fastify.lucia.createSession(user.username, {})
|
||||
const cookie = fastify.lucia.createSessionCookie(session.id)
|
||||
|
||||
reply.setCookie(cookie.name, cookie.value, cookie.attributes)
|
||||
|
||||
return {
|
||||
id: user.id,
|
||||
username: user.username,
|
||||
displayName: user.username,
|
||||
createdAt: user.createdAt.toISOString(),
|
||||
@@ -67,7 +66,6 @@ const plugin: FastifyPluginAsyncTypebox = async (fastify) => {
|
||||
const user = await fastify.prisma.user.findFirst({
|
||||
where: { username: req.body.username },
|
||||
select: {
|
||||
id: true,
|
||||
username: true,
|
||||
displayName: true,
|
||||
createdAt: true,
|
||||
@@ -84,7 +82,7 @@ const plugin: FastifyPluginAsyncTypebox = async (fastify) => {
|
||||
return reply.notFound('Incorrect username or password')
|
||||
}
|
||||
|
||||
const session = await fastify.lucia.createSession(user.id, {})
|
||||
const session = await fastify.lucia.createSession(user.username, {})
|
||||
const cookie = fastify.lucia.createSessionCookie(session.id)
|
||||
|
||||
reply.setCookie(cookie.name, cookie.value, cookie.attributes)
|
||||
@@ -112,7 +110,6 @@ const plugin: FastifyPluginAsyncTypebox = async (fastify) => {
|
||||
const user = req.user!
|
||||
|
||||
return {
|
||||
id: user.id,
|
||||
username: user.username,
|
||||
displayName: user.displayName,
|
||||
createdAt: user.createdAt.toISOString(),
|
||||
|
||||
Reference in New Issue
Block a user