diff --git a/.changeset/lemon-baboons-collect.md b/.changeset/lemon-baboons-collect.md new file mode 100644 index 00000000000..d5803860dfb --- /dev/null +++ b/.changeset/lemon-baboons-collect.md @@ -0,0 +1,5 @@ +--- +"@wso2is/identity-apps-core": patch +--- + +Hide username filed with deployment.toml change diff --git a/identity-apps-core/apps/recovery-portal/src/main/webapp/self-registration-username-request.jsp b/identity-apps-core/apps/recovery-portal/src/main/webapp/self-registration-username-request.jsp index 46929c40085..684e87117c9 100644 --- a/identity-apps-core/apps/recovery-portal/src/main/webapp/self-registration-username-request.jsp +++ b/identity-apps-core/apps/recovery-portal/src/main/webapp/self-registration-username-request.jsp @@ -120,6 +120,9 @@ String errorMsg = IdentityManagementEndpointUtil.getStringValue(request.getAttribute("errorMsg")); String consentPurposeGroupName = "SELF-SIGNUP"; String consentPurposeGroupType = "SYSTEM"; + boolean isEmailUsernameEnabled = MultitenantUtils.isEmailUserName(); + boolean hideUsernameFieldWhenEmailAsUsernameIsEnabled = Boolean.parseBoolean(config.getServletContext().getInitParameter( + "HideUsernameWhenEmailAsUsernameEnabled")); String[] missingClaimList = new String[0]; String[] missingClaimDisplayName = new String[0]; @@ -1605,6 +1608,10 @@ var error_msg = $("#error-msg"); var server_error_msg = $("#server-error-msg"); + if (<%=isEmailUsernameEnabled%> && <%=hideUsernameFieldWhenEmailAsUsernameIsEnabled%>) { + alphanumericUsernameUserInput.value = usernameUserInput.value; + } + if (!<%=isUsernameValidationEnabled%>) { if (showUsernameRegexValidationStatus()) { userName.value = alphanumericUsernameUserInput.value.trim(); @@ -1715,6 +1722,10 @@ var error_msg = $("#error-msg"); var server_error_msg = $("#server-error-msg"); + if (<%=isEmailUsernameEnabled%> && <%=hideUsernameFieldWhenEmailAsUsernameIsEnabled%>) { + alphanumericUsernameUserInput.value = usernameUserInput.value; + } + // Username validation. if (!<%=isUsernameValidationEnabled%>) { if (showUsernameRegexValidationStatus()) { diff --git a/identity-apps-core/features/org.wso2.identity.apps.recovery.portal.server.feature/resources/web.xml.j2 b/identity-apps-core/features/org.wso2.identity.apps.recovery.portal.server.feature/resources/web.xml.j2 index 086e35be530..a919d25ef1b 100644 --- a/identity-apps-core/features/org.wso2.identity.apps.recovery.portal.server.feature/resources/web.xml.j2 +++ b/identity-apps-core/features/org.wso2.identity.apps.recovery.portal.server.feature/resources/web.xml.j2 @@ -48,6 +48,12 @@ {{ accountrecoveryendpoint.auto_login_cookie_domain }} {% endif %} + {% if accountrecoveryendpoint.hide_username_when_email_as_username_enabled is defined %} + + HideUsernameWhenEmailAsUsernameEnabled + {{ accountrecoveryendpoint.hide_username_when_email_as_username_enabled }} + + {% endif %} {% if event.default_listener.validation.enable is defined %} isPasswordInputValidationEnabled