UPDATE ADMIN CAN MANUALLY UPDATE PASSWORD OF USER

This commit is contained in:
BIG2EYEZ
2023-12-21 20:35:54 +08:00
parent 071bd25719
commit 80a00338c6
5 changed files with 372 additions and 154 deletions

View File

@ -10,33 +10,25 @@
</head>
<body>
<div class="container mt-5">
<% if (resetError) { %>
<div class="alert alert-danger mb-3"><%= resetError %></div>
<% } else if (success) { %>
<div class="alert alert-success mb-3"><%= success %></div>
<p>Password changed successfully. <a href="/login">Click here to log in</a>.</p>
<% } else { %>
<% if (passwordValidationError) { %>
<form action="/reset-password/<%= token %>" method="post">
<div class="form-group">
<label for="password">New Password:</label>
<input type="password" class="form-control" id="password" name="password" required>
</div>
<div class="form-group">
<label for="confirmPassword">Confirm Password:</label>
<input type="password" class="form-control" id="confirmPassword" name="confirmPassword" required>
</div>
<% if (resetError) { %>
<div class="alert alert-danger mb-3"><%= resetError %></div>
<% } else if (passwordValidationError) { %>
<div class="alert alert-danger mb-3"><%= passwordValidationError %></div>
<% } %>
<form action="/reset-password/<%= token %>" method="post">
<div class="form-group">
<label for="password">New Password:</label>
<input type="password" class="form-control" id="password" name="password" required>
</div>
<div class="form-group">
<label for="confirmPassword">Confirm Password:</label>
<input type="password" class="form-control" id="confirmPassword" name="confirmPassword" required>
</div>
<button type="submit" class="btn btn-primary">Reset Password</button>
</form>
<% } %>
<button type="submit" class="btn btn-primary">Reset Password</button>
</form>
</div>
</body>
</html>