templates2.Store.Nuxt/server/api/auth/logout.post.ts
w4c-templates 228f2f01f2
Some checks failed
CI / quality (push) Has been cancelled
chore(template): publish Store.Nuxt
2026-10-11 23:24:30 +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);
});