Exemple #1
0
        public async Task <ActionResult <UserDto> > Register(RegisterUserDto registerUser)
        {
            if (await _userService.UserExists(registerUser.UserName))
            {
                return(BadRequest("მომხმარებელი უკვე არსებობს"));
            }
            var user = await _userService.RegisterUser(registerUser);

            return(new UserDto {
                UserName = user.UserName,
                Token = _tokenService.CreateTOken(user)
            });
        }