Skip to content

Commit

Permalink
Define a constant for "account-recovery-username"
Browse files Browse the repository at this point in the history
  • Loading branch information
hwupathum committed May 30, 2024
1 parent 520adfd commit 6920578
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export const ConnectorEditPage: FunctionComponent<ConnectorEditPageInterface> =
const { t } = useTranslation();
const { getLink } = useDocumentation();

const ACCOUNT_RECOVERY_BY_USERNAME: string = "account-recovery-username";
const featureConfig: FeatureConfigInterface = useSelector((state: AppState) => state.config.ui.features);
const allowedScopes: string = useSelector((state: AppState) => state?.auth?.allowedScopes);

Expand Down Expand Up @@ -184,7 +185,7 @@ export const ConnectorEditPage: FunctionComponent<ConnectorEditPageInterface> =
// TODO: remove this once the ID is fixed
updateData.properties.push({
name: GovernanceConnectorUtils.decodeConnectorPropertyName(
serverConfigurationConfig.connectorToggleName["account-recovery-username"]
serverConfigurationConfig.connectorToggleName[ACCOUNT_RECOVERY_BY_USERNAME]
),
value: data.checked.toString()
});
Expand Down Expand Up @@ -250,7 +251,7 @@ export const ConnectorEditPage: FunctionComponent<ConnectorEditPageInterface> =
name: ServerConfigurationsConstants.PASSWORD_RECOVERY_NOTIFICATION_BASED_RE_CAPTCHA,
value: data.checked.toString()
});
if ("account-recovery-username" in serverConfigurationConfig.connectorToggleName) {
if (ACCOUNT_RECOVERY_BY_USERNAME in serverConfigurationConfig.connectorToggleName) {
updateRecoveryCaptchaData.properties.push({
name: ServerConfigurationsConstants.USERNAME_RECOVERY_RE_CAPTCHA,
value: data.checked.toString()
Expand Down Expand Up @@ -621,7 +622,7 @@ export const ConnectorEditPage: FunctionComponent<ConnectorEditPageInterface> =
) }
</li>
{
serverConfigurationConfig.connectorToggleName["account-recovery-username"] ?
serverConfigurationConfig.connectorToggleName[ACCOUNT_RECOVERY_BY_USERNAME] ?
(<li>
{ t(
"extensions:manage.serverConfigurations.accountSecurity." +
Expand Down

0 comments on commit 6920578

Please sign in to comment.