Files
9router/src/app/api/auth/logout/route.js
T
EmirhanandCursor 6e9c7bf448 fix(auth): avoid stale redirects after auth changes
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>
2026-06-26 11:39:49 +07:00

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" } });
}