public IActionResult ResetSifre(string Email, string NovaSifra) { ResetSifreVM vm = new ResetSifreVM(); vm.Email = Email; return(View(vm)); }
public async Task <string> PromjenaSifreAsync(ResetSifreVM vm) { var user = await _userManager.FindByNameAsync(vm.Email); string resetToken = await _userManager.GeneratePasswordResetTokenAsync(user); var result = await _userManager.ResetPasswordAsync(user, resetToken, vm.NovaSifra); if (result.Succeeded) { return("Uspješno promjenjena šifra"); } else { return("Nešto je pošlo po zlu"); } }