File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/src/app/auth/openiddict Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,12 @@ export async function GET(request: NextRequest) {
1010 const session = await getSession ( )
1111 const openIdClientConfig = await getClientConfig ( )
1212 const currentUrl = new URL ( request . url )
13- currentUrl . host = ( await headers ( ) ) . get ( 'host' ) !
13+ const headersList = await headers ( )
14+ currentUrl . host = headersList . get ( 'host' ) !
15+ // remove the port if it exists in the host only in production
16+ if ( process . env . NODE_ENV === 'production' ) {
17+ currentUrl . host = currentUrl . host . split ( ':' ) [ 0 ]
18+ }
1419 const tokenSet = await client . authorizationCodeGrant ( openIdClientConfig , currentUrl , {
1520 pkceCodeVerifier : session . code_verifier ,
1621 expectedState : session . state
You can’t perform that action at this time.
0 commit comments