Пример #1
0
        public void LoginUser1()
        {
            var result = sut.Login(MockUser.testUser);

            Assert.IsTrue(result);

            MockConnection.CloseConnection();
        }
 public async void SetupTest()
 {
     // do everything to take us to the browser window...
     if (!(await _loginLogic.IsUserLoggedInAsync(ApplyLoggedInUser)))
     {
         _loginLogic.Login(ApplyLoggedInUser);
     }
 }
Пример #3
0
 public void Login()
 {
     try
     {
         _view.ShowSpinner(true);
         _logic.Login(ApplyUser);
     } catch (Exception ex)
     {
         _view.HandleException(ex);
     }
 }
Пример #4
0
        public ActionResult Index(LoginViewModel loginViewModel)
        {
            bool login = loginLogic.Login(loginViewModel);

            if (login)
            {
                HttpContext.Session.SetString("Email", loginViewModel.Email);
                HttpContext.Session.SetInt32("UserId", loginViewModel.UserId);

                return(RedirectToAction("Index", "Home"));
            }
            return(View());
        }
Пример #5
0
        public ActionResult Index(LoginViewModel user)
        {
            bool login = _loginLogic.Login(user);

            if (login)
            {
                HttpContext.Session.SetString("Email", user.Email);
                HttpContext.Session.SetInt32("UserId", user.UserId);
                System.Threading.Thread.Sleep(3500);
                return(RedirectToAction("Index", "Home"));
            }

            return(View());
        }
Пример #6
0
        public async Task <IActionResult> Login(LoginViewModel model)
        {
            if (ModelState.IsValid)
            {
                var user = new User {
                    UserName = model.Username, PasswordHash = model.Password,
                };
                await _loginLogic.Login(user);

                return(RedirectToAction("Index", "Home"));
            }

            ModelState.AddModelError(string.Empty, "Email en/of Wachtwoord is incorrect. Probeer het opnieuw.");
            return(View(model));
        }
Пример #7
0
 public void Login()
 {
     _view.ShowSpinner(true);
     _logic.Login(ApplyUser);
 }
Пример #8
0
 public UserViewModel Login([FromBody] LoginUiCommand command)
 {
     return(_loginLogic.Login(command));
 }