Beispiel #1
0
        public async Task <IActionResult> Login(LoginInputViewModel model)
        {
            if (!await AdminAuthenticationManager.SignIn(HttpContext, model.UserName, model.Password))
            {
                ModelState.AddModelError("Unauthorized", "User name or password is not correct.");
                return(View());
            }

            return(RedirectToAction("Index"));
        }
Beispiel #2
0
 public IActionResult Logout()
 {
     AdminAuthenticationManager.SignOut(HttpContext);
     return(RedirectToAction("Index", "Home"));
 }