Пример #1
0
        public IActionResult Authorization([FromBody] UserRegistrationModel model)
        {
            var user = _userService.GetUser(model.Name, model.Password);

            var token = _sessionService.Authorize(user.Name);

            return(new JsonResult(new AuthorizationResultModel(token, user)));
        }
Пример #2
0
        public async Task AuthorizeUserClient(int maxAttempts = 5)
        {
            if (_userApiClient.Authorized)
            {
                return;
            }

            await _sessionService.Authorize(_userApiClient, maxAttempts);
        }