From 91cb584a331f49860799e89344d5438af76eada0 Mon Sep 17 00:00:00 2001 From: Hui Zhao Date: Mon, 13 May 2024 16:54:20 -0700 Subject: [PATCH] fix redirect init --- packages/adapter-nextjs/src/oauth/utils/completeOAuthFlow.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/adapter-nextjs/src/oauth/utils/completeOAuthFlow.ts b/packages/adapter-nextjs/src/oauth/utils/completeOAuthFlow.ts index acdde9769f7..fa191f21992 100644 --- a/packages/adapter-nextjs/src/oauth/utils/completeOAuthFlow.ts +++ b/packages/adapter-nextjs/src/oauth/utils/completeOAuthFlow.ts @@ -44,9 +44,7 @@ export const completeOAuthFlow = async ({ const oAuthTokenEndpoint = `https://${oAuthConfig.domain}/oauth2/token`; - const response = NextResponse.redirect( - new URL(redirectOnComplete, request.url), - ); + const response = NextResponse.redirect(new URL(redirectOnComplete, origin)); const keyValueStorage = createKeyValueStorageFromCookieStorageAdapter( createCookieStorageAdapterFromNextServerContext({