11 lines
379 B
TypeScript
11 lines
379 B
TypeScript
import { NextResponse } from 'next/server';
|
|
import { destroySession } from '@/lib/server/auth';
|
|
|
|
export const dynamic = 'force-dynamic';
|
|
|
|
export async function POST() {
|
|
await destroySession();
|
|
// 303 so a plain HTML form POST turns into a GET of the home page.
|
|
return NextResponse.redirect(new URL('/', process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost:3000'), 303);
|
|
}
|