mirror of
https://github.com/KeyZox71/knl_meowscendence.git
synced 2025-12-31 21:56:41 +01:00
19 lines
426 B
JavaScript
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" });
|
|
}
|
|
}
|