Skip to content

Commit

Permalink
Merge pull request #7097 from sahandilshan/main
Browse files Browse the repository at this point in the history
Show only the email field in the regsitration field when the email as username is enabled
  • Loading branch information
sahandilshan authored Nov 8, 2024
2 parents 306bcf2 + f045386 commit 0b75191
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/lemon-baboons-collect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wso2is/identity-apps-core": patch
---

Hide username filed with deployment.toml change
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
<param-value>{{ accountrecoveryendpoint.auto_login_cookie_domain }}</param-value>
</context-param>
{% endif %}
{% if accountrecoveryendpoint.hide_username_when_email_as_username_enabled is defined %}
<context-param>
<param-name>HideUsernameWhenEmailAsUsernameEnabled</param-name>
<param-value>{{ accountrecoveryendpoint.hide_username_when_email_as_username_enabled }}</param-value>
</context-param>
{% endif %}
{% if event.default_listener.validation.enable is defined %}
<context-param>
<param-name>isPasswordInputValidationEnabled</param-name>
Expand Down

0 comments on commit 0b75191

Please sign in to comment.