🚸 ux: improve logout flow completely

This commit is contained in:
2026-02-18 12:53:58 +07:00
parent 0c9ca45b36
commit 39124f0db4
4 changed files with 23 additions and 12 deletions

View File

@ -1,9 +0,0 @@
import { cookies } from "next/headers";
import { redirect } from "next/navigation";
const page = async () => {
(await cookies()).delete("auth_token");
redirect("/");
};
export default page;

View File

@ -0,0 +1,7 @@
import { cookies } from "next/headers";
import { NextResponse } from "next/server";
export const GET = async (request: Request) => {
(await cookies()).delete("auth_token");
return NextResponse.redirect(new URL("/", request.url), 303);
};