Exemplo n.º 1
0
        public async Task <IActionResult> GetToken([FromBody] LoginInfoDto loginInfoDto)
        {
            SOApiResult <bool> resultLogin = await _userApiService.IsSucceedLogin(loginInfoDto);

            if (resultLogin.IsSucceed)
            {
                SOApiResult <string> result = await _userApiService.GenerateToken(loginInfoDto.UserName);

                if (result.IsSucceed)
                {
                    return(Ok(result.ReturnedDataJSON));
                }
                return(BadRequest(result.Message));
            }
            return(BadRequest(resultLogin.Message));
        }