PKCE check logic fix

This commit is contained in:
x
2025-04-28 13:28:47 -04:00
parent 8a035c8d82
commit b50a022d11

View File

@@ -687,8 +687,8 @@ export const oidcConfigServiceFactory = ({
// Check if the OIDC provider supports PKCE
const codeChallengeMethods = client.issuer.metadata.code_challenge_methods_supported;
const supportsPKCE =
!codeChallengeMethods || (Array.isArray(codeChallengeMethods) && codeChallengeMethods.includes("S256"));
// If codeChallengeMethods is undefined or includes "S256", then the provider supports PKCE
const supportsPKCE = Array.isArray(codeChallengeMethods) && codeChallengeMethods.includes("S256");
const strategy = new OpenIdStrategy(
{