SPB Git

spb/rareindex

Public
391 B · 12 lines typescript
1import { NextResponse } from 'next/server';2import { destroySession } from '@/lib/auth/session';34export const dynamic = 'force-dynamic';56/** POST /api/auth/logout — used by the user menu and by API clients; GET is not allowed (CSRF). */7export async function POST(req: Request) {8  await destroySession();9  const url = new URL('/', req.url);10  return NextResponse.redirect(url, 303);11}12
Files · e0d6c47e5aa347b26dd853d903e96b01e1bb2a96
Menu

Theme