Use full-page navigation after login/logout so the dashboard reloads with the fresh auth cookie, and mark login/logout responses no-store. Fixes #2100 Co-authored-by: Cursor <cursoragent@cursor.com>
13 lines
479 B
JavaScript
13 lines
479 B
JavaScript
import { NextResponse } from "next/server";
|
|
import { cookies } from "next/headers";
|
|
import { clearDashboardAuthCookie } from "@/lib/auth/dashboardSession";
|
|
|
|
export async function POST() {
|
|
const cookieStore = await cookies();
|
|
clearDashboardAuthCookie(cookieStore);
|
|
cookieStore.delete("oidc_state");
|
|
cookieStore.delete("oidc_nonce");
|
|
cookieStore.delete("oidc_code_verifier");
|
|
return NextResponse.json({ success: true }, { headers: { "Cache-Control": "no-store" } });
|
|
}
|