Allow false to be set for pkceMethod option (#28347)

Closes #28335

Signed-off-by: Jon Koops <jonkoops@gmail.com>
This commit is contained in:
Jon Koops 2024-04-09 09:33:12 +02:00 committed by GitHub
parent 3fffc5182e
commit 9651af4a1c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -132,10 +132,11 @@ function Keycloak (config) {
kc.silentCheckSsoFallback = true; kc.silentCheckSsoFallback = true;
} }
if (initOptions.pkceMethod) { if (typeof initOptions.pkceMethod !== "undefined") {
if (initOptions.pkceMethod !== "S256") { if (initOptions.pkceMethod !== "S256" && initOptions.pkceMethod !== false) {
throw new TypeError(`Invalid value for 'pkceMethod', expected 'S256' but got '${initOptions.pkceMethod}'.`); throw new TypeError(`Invalid value for pkceMethod', expected 'S256' or false but got ${initOptions.pkceMethod}.`);
} }
kc.pkceMethod = initOptions.pkceMethod; kc.pkceMethod = initOptions.pkceMethod;
} else { } else {
kc.pkceMethod = "S256"; kc.pkceMethod = "S256";