Skip to content

Commit c71cb84

Browse files
fix(oauth): set httpOptions before issuer discovery (#3537)
* Update client.ts Set custom.setHttpOptionsDefaults before Issuer.discover(.wellKnown). This allow discover the .wellKnown endpoint behind a proxy * chore: address code review Co-authored-by: Balázs Orbán <[email protected]>
1 parent a09a75b commit c71cb84

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/core/lib/oauth/client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ export async function openidClient(
1212
options: InternalOptions<"oauth">
1313
): Promise<Client> {
1414
const provider = options.provider
15-
15+
16+
if (provider.httpOptions) custom.setHttpOptionsDefaults(provider.httpOptions)
17+
1618
let issuer: Issuer
1719
if (provider.wellKnown) {
1820
issuer = await Issuer.discover(provider.wellKnown)
@@ -44,7 +46,5 @@ export async function openidClient(
4446
// and https://github.com/nextauthjs/next-auth/issues/3067
4547
client[custom.clock_tolerance] = 10
4648

47-
if (provider.httpOptions) custom.setHttpOptionsDefaults(provider.httpOptions)
48-
4949
return client
5050
}

0 commit comments

Comments
 (0)