public ActionResult RecoverPassword(RecoverPasswordModel model)
 {
     if (model.Confirmpassword != model.Password)
     {
         Error("Las contraseñas deben coincidir.");
         return View(model);
     }
     else
     {
         var account = _readOnlyRepository.First<Account>(x => x.Email == model.Email);
         account.Password = model.Password;
         _writeOnlyRepository.Update(account);
         Success("Se ha cambiado su clave con exito.");
     }
     return RedirectToAction("LogIn","Account");
 }
        public ActionResult RecoverPassword(string token)
        {
            var tok = _readOnlyRepository.First<Token>(x => x.Name == token);
            var currentDate = DateTime.Now;
            if (tok == null) return RedirectToAction("LogIn", "Account");

            if (tok.ExpirationDate < currentDate)
            {
                Error("Ese token ya expiro, vuelve a pedir recuperar la cuenta");
            }
            else
            {

                var model = new RecoverPasswordModel();
                var account = _readOnlyRepository.First<Account>(x => x.Id == tok.UserId);
                model.Email = account.Email;
                return View(model);
            }

            return RedirectToAction("LogIn", "Account");
        }