Callback 修复补丁:redirect URL 改用 siteUrl 构造,避免跳转到 localhost:3000
This commit is contained in:
@@ -27,9 +27,8 @@ export async function GET(request: NextRequest) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const nextPath = normalizeNextPath(request.nextUrl.searchParams.get("next"));
|
const nextPath = normalizeNextPath(request.nextUrl.searchParams.get("next"));
|
||||||
const redirectUrl = request.nextUrl.clone();
|
const baseUrl = siteUrl || request.nextUrl.origin;
|
||||||
redirectUrl.pathname = nextPath;
|
const redirectUrl = new URL(nextPath, baseUrl);
|
||||||
redirectUrl.search = "";
|
|
||||||
|
|
||||||
if (!hasSupabaseServerEnv()) {
|
if (!hasSupabaseServerEnv()) {
|
||||||
return NextResponse.redirect(redirectUrl);
|
return NextResponse.redirect(redirectUrl);
|
||||||
|
|||||||
Reference in New Issue
Block a user