From e58773c918bbdb8ba510f53fa8c89cbea35b1c6d Mon Sep 17 00:00:00 2001 From: sahandilshan Date: Thu, 7 Nov 2024 18:43:30 +0530 Subject: [PATCH 1/3] Hide username according to deployment.toml changes --- .../src/main/webapp/self-registration-username-request.jsp | 3 +++ .../resources/web.xml.j2 | 6 ++++++ 2 files changed, 9 insertions(+) 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 1f7f64e831b..65a08458463 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 @@ -114,6 +114,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]; 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 2ab0a198787..79de2b1d147 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 From 4cb70f7fea193b10a2e3ccf6ec74d0496de470e9 Mon Sep 17 00:00:00 2001 From: sahandilshan Date: Thu, 7 Nov 2024 18:48:28 +0530 Subject: [PATCH 2/3] =?UTF-8?q?Add=20changeset=20=F0=9F=A6=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/lemon-baboons-collect.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/lemon-baboons-collect.md 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 From f045386a2cef7851081e974163048a163ab65347 Mon Sep 17 00:00:00 2001 From: sahandilshan Date: Thu, 7 Nov 2024 18:51:59 +0530 Subject: [PATCH 3/3] Hide field --- .../main/webapp/self-registration-username-request.jsp | 8 ++++++++ 1 file changed, 8 insertions(+) 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 65a08458463..137eb881432 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 @@ -1602,6 +1602,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(); @@ -1712,6 +1716,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()) {