Example #1
0
 public OperationResult<bool> Login(LoginViewModel loginViewModel, IAuthenticationManager authentication)
 {
     var identity = this.loginService.GetUserIndentity(loginViewModel);
     var userIdentity = identity.Result;
     authentication.SignIn(new AuthenticationProperties { IsPersistent = loginViewModel.RememberMe }, userIdentity);
     return new OperationResult<bool>(true);
 }
Example #2
0
 public ActionResult Index(LoginViewModel loginViewModel)
 {
     var authentication = this.HttpContext.GetOwinContext().Authentication;
     var result = this.loginLogic.Login(loginViewModel, authentication);
     if (result.Success)
     {
         return this.RedirectToAction("Index", "Concepts");
     }
     return null;
 }
Example #3
0
        public static LoginViewModel CreateValid()
        {
            var result = new LoginViewModel
                             {
                                 Password = "******",
                                 RememberMe = false,
                                 UserName = "******"
                             };

            return result;
        }
Example #4
0
 public OperationResult<LoginViewModel> GetLoginViewModel()
 {
     var data = new LoginViewModel();
     var result = new OperationResult<LoginViewModel>(data);
     return result;
 }