brf/server/plugins/auth/routes/logout.ts
2025-12-18 07:31:37 +01:00

20 lines
326 B
TypeScript

import type { RouteHandler } from 'fastify'
/** @type {import('fastify').FastifySchema} */
const schema = {
response: {
'3XX': {},
},
}
const logout: RouteHandler = async function (request, reply) {
await request.logout()
return reply.redirect('/admin/login')
}
export default {
handler: logout,
schema,
}