Пример #1
0
        public async Task <LoginResponse> Register([FromBody] RegisterRequest request)
        {
            var registerModel = _mapper.Map <RegisterModel>(request);
            await _userService.RegisterUser(registerModel);

            var token = await _tokenProvider.Authenticate(request.UserName, request.Password);

            return(new LoginResponse()
            {
                AccessToken = token
            });
        }