Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix renamed password field in self registration flow #6892

Merged
merged 2 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/itchy-zebras-argue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wso2is/identity-apps-core": patch
---

Reset password field name to password.
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,9 @@
<input
class="form-control"
type="password"
id="passwordUserInput"
id="password"
value=""
name="passwordUserInput"
name="password"
tabindex="1"
placeholder="<%=IdentityManagementEndpointUtil.i18n(recoveryResourceBundle, "enter.your.password")%>"
required
Expand Down Expand Up @@ -886,7 +886,7 @@
<script type="text/javascript">
var registrationDataKey = "registrationData";
var $registerForm = $("#register");
var passwordField = $("#passwordUserInput");
var passwordField = $("#password");
var passwordValidationBlock = $("#password-validation-block");
var validPassword = false;
var passwordConfig = <%=passwordConfig%>;
Expand Down Expand Up @@ -979,14 +979,14 @@
});

// Fires when password field lose focus.
$('#passwordUserInput').bind('blur keyup', function () {
$('#password').bind('blur keyup', function () {
showPasswordValidationStatus();
showMismatchPasswordValidationStatus();

});

// Fires on password field input.
$('#passwordUserInput').bind('input', function () {
$('#password').bind('input', function () {
hidePasswordValidationStatus();
});

Expand Down Expand Up @@ -1144,8 +1144,8 @@
}

// Password validation.
var passwordUserInput = document.getElementById("passwordUserInput");
var password = document.getElementById("passwordUserInput");
var passwordUserInput = document.getElementById("password");
var password = document.getElementById("password");

if (showPasswordValidationStatus()) {
if (passwordUserInput) {
Expand Down Expand Up @@ -1218,7 +1218,7 @@

var data = $("#register").serializeArray();
var filteredData = data.filter(function(row) {
return !(row.name === "passwordUserInput" || row.name === "password2");
return !(row.name === "password" || row.name === "password2");
mpmadhavig marked this conversation as resolved.
Show resolved Hide resolved
});

sessionStorage.setItem(registrationDataKey, JSON.stringify(filteredData));
Expand Down Expand Up @@ -1589,7 +1589,7 @@

// show password function
function showPassword() {
var passwordField = $('#passwordUserInput');
var passwordField = $('#password');

if (passwordField.attr("type") === 'text') {
passwordField.attr("type", "password")
Expand Down Expand Up @@ -1680,8 +1680,7 @@
}

function showPasswordValidationStatus() {
var password = document.getElementById("passwordUserInput");
var passwordUserInput = document.getElementById("passwordUserInput");
var passwordUserInput = document.getElementById("password");
var passwordField = $("#passwordField");
var password_error_msg = $("#password-error-msg");
var server_error_msg = $("#server-error-msg");
Expand Down Expand Up @@ -1745,7 +1744,7 @@
}

function showMismatchPasswordValidationStatus() {
var passwordInput = document.getElementById("passwordUserInput");
var passwordInput = document.getElementById("password");
var confirmPasswordInput = document.getElementById("password2");
var password_mismatch_error_msg = $("#password-mismatch-error-msg");
var password_mismatch_error_msg_text = $("#password-mismatch-error-msg-text");
Expand Down Expand Up @@ -2073,7 +2072,7 @@
if (!isPasswordProvisionEnabled) {
return true;
}
var passwordInput = document.getElementById("passwordUserInput");
var passwordInput = document.getElementById("password");
var confirmPasswordInput = document.getElementById("password2");

if ( (!!passwordInput && passwordInput.value.trim() == "")
Expand Down
Loading