fix
This commit is contained in:
parent
944c81687a
commit
982b9580a6
|
@ -51,7 +51,7 @@ button {
|
|||
background-color: #007bff;
|
||||
color: #fff;
|
||||
border: none;
|
||||
border-radius: 3px;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
@ -125,6 +125,12 @@ button:hover {
|
|||
function resetPassword() {
|
||||
const new_password = document.getElementById("new_password").value;
|
||||
const confirm_password = document.getElementById("confirm_password").value;
|
||||
|
||||
if (!/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}$/.test(new_password)) {
|
||||
alert("The password must be at least 8 characters in length, and contain at least 1 number, 1 lowercase letter and 1 uppercase letter.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (new_password !== confirm_password) {
|
||||
alert("Passwords do not match");
|
||||
return;
|
||||
|
@ -145,11 +151,11 @@ function resetPassword() {
|
|||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.code == 200 ) {
|
||||
alert(data.msg);
|
||||
{{/* window.location.href = "{{.HomePage}}"; */}}
|
||||
setTimeout(function() {
|
||||
alert("reset password success");
|
||||
window.location.href = "{{.HomePage}}";
|
||||
{{/* setTimeout(function() {
|
||||
window.location.href = "{{.HomePage}}";
|
||||
}, 1000);
|
||||
}, 1000); */}}
|
||||
} else {
|
||||
alert(data.msg);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user