brf/server/plugins/auth/routes/logout.ts
2026-06-15 14:09:28 +02:00

19 lines
303 B
TypeScript

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