」 feat(auth-api): /logout added

This commit is contained in:
2025-10-01 19:44:48 +02:00
parent db5858a344
commit ae4838166b
2 changed files with 20 additions and 0 deletions

17
src/api/auth/logout.js Normal file
View 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" });
}
}