create middleware block and update proxy file also make token stored in cookes and up date user page to can show user details also fixed delete user error and delete car error and broken corse inginx image block now we can uplode image to server and but it in my app

This commit is contained in:
m7amedez5511
2026-06-17 17:01:53 +03:00
parent 6ca2cc08d1
commit a23d21f222
15 changed files with 1017 additions and 137 deletions

View File

@@ -0,0 +1,17 @@
// app/api/auth/clear-cookie/route.ts
// Clears the HttpOnly auth cookie on logout.
// Only the server can delete an HttpOnly cookie.
import { NextResponse } from "next/server";
export async function POST() {
const response = NextResponse.json({ ok: true });
// Overwrite the cookie with an empty value and a past expiry date.
response.headers.set(
"Set-Cookie",
"auth_token=; HttpOnly; Secure; SameSite=Strict; Path=/; Max-Age=0",
);
return response;
}