From 6c10e4a0701d5076afa69d6fd1c87bea872ec096 Mon Sep 17 00:00:00 2001 From: Vladimir Gorej Date: Mon, 31 Jan 2022 14:21:15 +0100 Subject: [PATCH] fix(auth): compensate for uninitialized config Refs #7814 --- src/core/components/auth/oauth2.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/components/auth/oauth2.jsx b/src/core/components/auth/oauth2.jsx index a83340b8..9afa70b4 100644 --- a/src/core/components/auth/oauth2.jsx +++ b/src/core/components/auth/oauth2.jsx @@ -130,8 +130,8 @@ export default class Oauth2 extends React.Component { const AUTH_FLOW_ACCESS_CODE = isOAS3() ? (oidcUrl ? "authorization_code" : "authorizationCode") : "accessCode" const AUTH_FLOW_APPLICATION = isOAS3() ? (oidcUrl ? "client_credentials" : "clientCredentials") : "application" - let authConfigs = authSelectors.getConfigs() - let isPkceCodeGrant = authConfigs.usePkceWithAuthorizationCodeGrant === "true" || authConfigs.usePkceWithAuthorizationCodeGrant === true + let authConfigs = authSelectors.getConfigs() || {} + let isPkceCodeGrant = !!authConfigs.usePkceWithAuthorizationCodeGrant let flow = schema.get("flow") let flowToDisplay = flow === AUTH_FLOW_ACCESS_CODE && isPkceCodeGrant ? flow + " with PKCE" : flow