示例#1
0
 public ActionResult ChangePassword(ChangePassword model)
 {
     try
     {
         if (ModelState.IsValid)
         {
             var recoverCode = new RecoveryCode
             {
                 Email       = model.Email,
                 NewPassword = model.Password,
                 RecoverCode = model.RecoveryCode
             };
             var changeWebPassword = _accessTokenService.ChangeWebPassword(recoverCode);
             return(RedirectToAction("Index").WithSuccess("Lösenordet har blivit utbytt."));
         }
         else
         {
             return(View());
         }
     }
     catch (Exception ex)
     {
         _log.ErrorFormat("Error in changing web user password. Error : {0}", ex.Message);
         _log.Error(ex);
         return(View().WithError(ex.Message));
     }
 }