added forgot password feature.

This commit is contained in:
DESKTOP-GENO133\IvanPlex
2024-01-13 12:50:55 -07:00
parent 2247b1b1db
commit 8d989ee81c
9 changed files with 198 additions and 5 deletions

View File

@@ -24,6 +24,31 @@ function performRegistration() {
}
});
}
function requestPasswordReset() {
var userName = $("#inputUserName").val();
$.post('/Login/RequestResetPassword', { userName: userName }, function (data) {
if (data.success) {
successToast(data.message);
setTimeout(function () { window.location.href = '/Login/Index' }, 500);
} else {
errorToast(data.message);
}
})
}
function performPasswordReset() {
var token = $("#inputToken").val();
var userPassword = $("#inputUserPassword").val();
var userEmail = $("#inputEmail").val();
$.post('/Login/PerformPasswordReset', { password: userPassword, token: token, emailAddress: userEmail }, function (data) {
if (data.success) {
successToast(data.message);
setTimeout(function () { window.location.href = '/Login/Index' }, 500);
} else {
errorToast(data.message);
}
});
}
function handlePasswordKeyPress(event) {
if (event.keyCode == 13) {
performLogin();