Exemple #1
0
 public async Task <IActionResult> Test([FromBody] AuthRegisterInputModel registerInfo)
 {
     return(Ok(new AuthResultModel()
     {
         Message = "Test"
     }));
 }
Exemple #2
0
        public async Task <IActionResult> Register([FromBody] AuthRegisterInputModel registerInfo)
        {
            if (await _userService.RegisterAsync(
                    _mapper.Map <AuthRegisterInputModel, AuthRegisterDto>(registerInfo)))
            {
                return(Ok(new AuthResultModel()
                {
                    Message = "Registered"
                }));
            }

            return(BadRequest(new AuthResultModel {
                Message = "Username is already taken"
            }));
        }