コード例 #1
0
        public ActionResult Login(LoginViewModel model)
        {
            var loginStatus = SignInManager.PasswordSignIn(model.UserName, model.Password, model.RememberMe, true);

            if (loginStatus == SignInStatus.Success)
            {
                var userId = UserManager.FindByName(model.UserName)?.Id;
                var roleId = _repository.GetUserRole(userId);
                return(!_repository.CheckUserDataComplete(userId) && roleId != (int)Enums.Roles.Admin ? RedirectToAction("AddAccountDetails") : RedirectToAction("Index", "Home"));
            }

            return(View(model));
        }