mirror of
https://github.com/KeyZox71/knl_meowscendence.git
synced 2026-01-01 06:06:41 +01:00
「✨」 feat(auth-api): /logout added
This commit is contained in:
17
src/api/auth/logout.js
Normal file
17
src/api/auth/logout.js
Normal file
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @async
|
||||
* @param {import("fastify").FastifyReply} reply
|
||||
*
|
||||
* @returns {import("fastify").FastifyReply}
|
||||
*/
|
||||
export async function logout(reply) {
|
||||
try {
|
||||
return reply
|
||||
.code(200)
|
||||
.clearCookie()
|
||||
.send({ msg: "Logout successful" });
|
||||
} catch {
|
||||
fastify.log.error(err);
|
||||
return reply.code(500).send({ error: "Internal server error" });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user