diff --git a/app/api/auth/logout/route.tsx b/app/api/auth/logout/route.tsx index a3a5ede..075f76d 100644 --- a/app/api/auth/logout/route.tsx +++ b/app/api/auth/logout/route.tsx @@ -1,4 +1,3 @@ -// app/api/auth/logout/route.ts import { NextResponse } from "next/server"; import { cookies } from "next/headers"; @@ -8,21 +7,18 @@ export async function DELETE() { // Clear the authentication cookie. // This MUST match the name of the cookie set during login. // In your login handler, the cookie is named "auth_token". - (await - // Clear the authentication cookie. - // This MUST match the name of the cookie set during login. - // In your login handler, the cookie is named "auth_token". - cookies()).delete("auth_token"); + const cookieStore = await cookies(); + cookieStore.delete("auth_token"); return NextResponse.json( { success: true, message: "Logged out successfully" }, - { status: 200 } + { status: 200 }, ); } catch (error) { console.error("Logout API error:", error); return NextResponse.json( { success: false, message: "Internal server error during logout" }, - { status: 500 } + { status: 500 }, ); } } diff --git a/app/dashboard/approve/page.tsx b/app/dashboard/approve/page.tsx index 55ccd20..dd6dcd4 100644 --- a/app/dashboard/approve/page.tsx +++ b/app/dashboard/approve/page.tsx @@ -1,9 +1,7 @@ -// This ensures this component is rendered only on the client side "use client"; import { Approve } from "@/app/features/Pages/Approve/Approve"; - export default function ApprovePage() { return (
- Please log in to access the backoffice. -
-