Update templates/reset-password.html
Browse files- templates/reset-password.html +25 -10
templates/reset-password.html
CHANGED
@@ -1,21 +1,36 @@
|
|
1 |
<!DOCTYPE html>
|
2 |
<html>
|
3 |
<head>
|
4 |
-
<title>Reset
|
5 |
-
<!--
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
</head>
|
7 |
<body>
|
8 |
-
<form
|
9 |
-
<input type="hidden"
|
|
|
10 |
<label for="new-password">New Password:</label>
|
11 |
<input type="password" id="new-password" name="new_password" required><br><br>
|
|
|
|
|
|
|
|
|
12 |
<button type="submit">Reset Password</button>
|
13 |
</form>
|
14 |
-
<script>
|
15 |
-
// Extract the token from the URL
|
16 |
-
const urlParams = new URLSearchParams(window.location.search);
|
17 |
-
const token = urlParams.get('token');
|
18 |
-
document.getElementById('token').value = token;
|
19 |
-
</script>
|
20 |
</body>
|
21 |
</html>
|
|
|
1 |
<!DOCTYPE html>
|
2 |
<html>
|
3 |
<head>
|
4 |
+
<title>Password Reset</title>
|
5 |
+
<!-- Add your additional head elements here -->
|
6 |
+
<script>
|
7 |
+
function validatePassword() {
|
8 |
+
var password = document.getElementById("new-password").value;
|
9 |
+
var confirmPassword = document.getElementById("confirm-password").value;
|
10 |
+
var regex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{6,}$/;
|
11 |
+
|
12 |
+
if (password != confirmPassword) {
|
13 |
+
alert("Passwords do not match.");
|
14 |
+
return false;
|
15 |
+
} else if (!regex.test(password)) {
|
16 |
+
alert("Password must be at least 6 characters long and include at least one lowercase letter, one uppercase letter, one numeric digit, and one special character.");
|
17 |
+
return false;
|
18 |
+
}
|
19 |
+
return true;
|
20 |
+
}
|
21 |
+
</script>
|
22 |
</head>
|
23 |
<body>
|
24 |
+
<form action="/reset-password" method="post" onsubmit="return validatePassword()">
|
25 |
+
<input type="hidden" name="token" value="{{ token }}">
|
26 |
+
|
27 |
<label for="new-password">New Password:</label>
|
28 |
<input type="password" id="new-password" name="new_password" required><br><br>
|
29 |
+
|
30 |
+
<label for="confirm-password">Confirm Password:</label>
|
31 |
+
<input type="password" id="confirm-password" required><br><br>
|
32 |
+
|
33 |
<button type="submit">Reset Password</button>
|
34 |
</form>
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
</body>
|
36 |
</html>
|