feat: added informatic output to the ResetPassword page
Signed-off-by: limited_dev <loginakkisativ@gmail.com>
This commit is contained in:
parent
9c93f9d10c
commit
993c3c1a63
1 changed files with 7 additions and 1 deletions
|
@ -27,18 +27,24 @@
|
||||||
|
|
||||||
private async void resetPassword()
|
private async void resetPassword()
|
||||||
{
|
{
|
||||||
Console.WriteLine("Resetting Password...");
|
msg = "Checking...";
|
||||||
var user = await UsersRepository.getUserByEmailRawAsync(Email);
|
var user = await UsersRepository.getUserByEmailRawAsync(Email);
|
||||||
if (user == null)
|
if (user == null)
|
||||||
{
|
{
|
||||||
|
msg = "This user is not registered.";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Console.WriteLine("Resetting a password...");
|
||||||
|
|
||||||
|
msg = "Generating";
|
||||||
|
|
||||||
var hash = TheManager.getmd5Hash();
|
var hash = TheManager.getmd5Hash();
|
||||||
user.ResetPasswordToken = hash;
|
user.ResetPasswordToken = hash;
|
||||||
user.ResetPasswordExpiresAt = DateTimeOffset.Now.ToUnixTimeMilliseconds() + 300000;
|
user.ResetPasswordExpiresAt = DateTimeOffset.Now.ToUnixTimeMilliseconds() + 300000;
|
||||||
|
|
||||||
await UsersRepository.updateUserAsync(user);
|
await UsersRepository.updateUserAsync(user);
|
||||||
|
|
||||||
|
msg = "Sending...";
|
||||||
|
|
||||||
Postman.sendMail(user.Email,
|
Postman.sendMail(user.Email,
|
||||||
"Password Reset",
|
"Password Reset",
|
||||||
|
|
Loading…
Reference in a new issue