예제 #1
0
        public async Task <IActionResult> login(LoginModel loginModel, string returnUrl)
        {
            ViewBag.IsSuccess = false;
            if (ModelState.IsValid)
            {
                var result = await _authenticateRepository.PasswordSignInAsync(loginModel);

                if (result.Succeeded)
                {
                    if (!string.IsNullOrEmpty(returnUrl))
                    {
                        return(LocalRedirect(returnUrl));
                    }
                    return(RedirectToAction("UserHome", "BankHome"));
                }
                ModelState.AddModelError("", "Invalid Credentials");
            }

            return(View());
        }