fix: added validation of (if old password === new password)
This commit is contained in:
parent
213d744661
commit
25f759321f
1 changed files with 11 additions and 0 deletions
|
|
@ -82,11 +82,21 @@ frappe.ready(function() {
|
|||
clear: true
|
||||
});
|
||||
}
|
||||
if (args.old_password === args.new_password) {
|
||||
frappe.msgprint({
|
||||
title: "{{ _('Invalid Password') }}",
|
||||
message: "{{ _('New password cannot be same as old password') }}",
|
||||
});
|
||||
$('.password-strength-message').addClass('hidden');
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.new_password !== confirm_password) {
|
||||
$('.password-mismatch-message').text("{{ _('Passwords do not match') }}")
|
||||
.removeClass('hidden text-muted').addClass('text-danger');
|
||||
$('.password-strength-message').addClass('hidden');
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
frappe.call({
|
||||
|
|
@ -139,6 +149,7 @@ frappe.ready(function() {
|
|||
|
||||
|
||||
$("#old_password, #new_password, #confirm_password").on("keyup", function () {
|
||||
|
||||
if (!frappe.utils.get_url_arg("key")) {
|
||||
if (
|
||||
$("#old_password").val() &&
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue