From dee056a76af4805e43d56e2b676dc4cc68c6dcd1 Mon Sep 17 00:00:00 2001 From: feie9456 Date: Fri, 17 Apr 2026 13:04:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=80=80=E5=87=BA=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/account/logout/route.ts | 7 +++++-- app/api/family/session/route.ts | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/api/account/logout/route.ts b/app/api/account/logout/route.ts index 78511d8..ca4de18 100644 --- a/app/api/account/logout/route.ts +++ b/app/api/account/logout/route.ts @@ -2,10 +2,13 @@ import { NextResponse } from "next/server"; import { clearCurrentCaregiverSession } from "@/lib/session"; -export async function POST(request: Request) { +export async function POST() { await clearCurrentCaregiverSession(); - return NextResponse.redirect(new URL("/login", request.url), { + return new NextResponse(null, { status: 303, + headers: { + Location: "/login", + }, }); } \ No newline at end of file diff --git a/app/api/family/session/route.ts b/app/api/family/session/route.ts index e91b080..916babe 100644 --- a/app/api/family/session/route.ts +++ b/app/api/family/session/route.ts @@ -13,7 +13,10 @@ export async function GET(request: NextRequest) { const caregiver = await getCaregiverSession(); const location = caregiver ? redirectTo : buildCaregiverLoginPath(redirectTo); - return NextResponse.redirect(new URL(location, request.url), { + return new NextResponse(null, { status: 307, + headers: { + Location: location, + }, }); } \ No newline at end of file