brf/server/plugins/auth/routes/logout.ts

19 lines
309 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('/admin/login')
}
export default {
handler: logout,
schema,
}