templates2.Admin.Nuxt/server/api/auth/logout.post.ts
w4c-templates 914988e187
Some checks failed
CI / quality (push) Has been cancelled
chore(template): publish Admin.Nuxt
2026-10-11 23:25:56 +03:00

8 lines
250 B
TypeScript

import { destroySession } from '../../utils/auth';
export default defineEventHandler(async (event) => {
await destroySession(event);
// 303 so a plain HTML form POST turns into a GET of the home page.
return sendRedirect(event, '/', 303);
});