Initial commit: Kalendartool (Next.js, Prisma, Docker)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
13
app/api/auth/logout/route.ts
Normal file
13
app/api/auth/logout/route.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
/** POST /api/auth/logout - beendet die Session (Cookie loeschen). */
|
||||
import { NextResponse } from 'next/server';
|
||||
import { clearSessionCookie } from '@/lib/auth/session';
|
||||
import { errorResponse } from '@/lib/api/responses';
|
||||
|
||||
export async function POST(): Promise<NextResponse> {
|
||||
try {
|
||||
await clearSessionCookie();
|
||||
return NextResponse.json({ ok: true });
|
||||
} catch (error) {
|
||||
return errorResponse(error);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user