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:
17
app/api/clear-cookie/route.ts
Normal file
17
app/api/clear-cookie/route.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user