Files
knl_meowscendence/src/api/auth/logout.js
2025-10-01 20:16:58 +02:00

19 lines
426 B
JavaScript

/**
* @async
* @param {import("fastify").FastifyReply} reply
* @param {import("fastify").FastifyInstance} fastify
*
* @returns {import("fastify").FastifyReply}
*/
export async function logout(reply, fastify) {
try {
return reply
.code(200)
.clearCookie("token")
.send({ msg: "Logout successful" });
} catch {
fastify.log.error(err);
return reply.code(500).send({ error: "Internal server error" });
}
}