コード例 #1
0
        public async Task <IActionResult> Login(AuthViewModels model)
        {
            if (ModelState.IsValid)
            {
                bool isUserExist = _repository.CheckLoginPassword(new BLL.Models.BLLUser {
                    Email = model.Email, Password = model.Password
                });
                if (isUserExist)
                {
                    await Authenticate(model.Email); // аутентификация

                    return(RedirectToAction("Index", "Home"));
                }
                ModelState.AddModelError("", "Некорректные логин и(или) пароль");
            }
            return(View(model));
        }
コード例 #2
0
 public LoginPage()
 {
     InitializeComponent();
     auth  = new UserModels();
     _auth = new AuthViewModels();
 }