From 1ac41dde337e2ecbfa82ea1cfc8f7fbda68fbece Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Tue, 26 May 2026 04:48:07 +0800 Subject: [PATCH] =?UTF-8?q?Callback=20=E4=BF=AE=E5=A4=8D=E8=A1=A5=E4=B8=81?= =?UTF-8?q?=EF=BC=9Aredirect=20URL=20=E6=94=B9=E7=94=A8=20siteUrl=20?= =?UTF-8?q?=E6=9E=84=E9=80=A0=EF=BC=8C=E9=81=BF=E5=85=8D=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E5=88=B0=20localhost:3000?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/app/auth/callback/route.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/app/auth/callback/route.ts b/frontend/app/auth/callback/route.ts index c6adec29..8c48ac1c 100644 --- a/frontend/app/auth/callback/route.ts +++ b/frontend/app/auth/callback/route.ts @@ -27,9 +27,8 @@ export async function GET(request: NextRequest) { } const nextPath = normalizeNextPath(request.nextUrl.searchParams.get("next")); - const redirectUrl = request.nextUrl.clone(); - redirectUrl.pathname = nextPath; - redirectUrl.search = ""; + const baseUrl = siteUrl || request.nextUrl.origin; + const redirectUrl = new URL(nextPath, baseUrl); if (!hasSupabaseServerEnv()) { return NextResponse.redirect(redirectUrl);