コード例 #1
0
        public async Task <IActionResult> Login([FromBody] LoginUserParams userParams)
        {
            var user = await _userEngine.FindUserByUsername(userParams.Username);

            var signInResult = await _userEngine.PasswordSignInUser(user, userParams.Password);

            if (signInResult.Succeeded)
            {
                return(Json(signInResult));
            }
            return(Unauthorized());
        }