Exemplo n.º 1
0
 public ActionResult UserProfile()
 {
     var model = new ResetPasswordViewModel();
     var user = User.Identity.Name;
     model.Email = user;
     return View(model);
 }
Exemplo n.º 2
0
 public async Task<ActionResult> UserProfile(ResetPasswordViewModel model)
 {
    // var user = _accountService.GetAccountByEmail(User.Identity.Name);
     DataSettingsHelper.ResetCache();
     var user =  _accountService.GetAccountByEmail(model.Email);
     if (user == null)
     {
         // Don't reveal that the user does not exist
         return RedirectToAction("ResetPasswordConfirmation", "Account");
     }
     const PasswordFormat passworkFormat = new PasswordFormat();
     var changePasswordRequest = new ChangePasswordRequest(model.Email, true, passworkFormat, model.OldPassword);
     // _accountService.InsertGuestAccount
     var registrationResult = _accountRegistrationService.ChangePassword(changePasswordRequest);
     //var result = await UserManager.ResetPasswordAsync(model.Email, model.OldPassword, model.Password);
   
         return RedirectToAction("Index", "Home");
     
  
    
     return View(model);
 }