Exemple #1
0
        public async Task <IActionResult> Register([FromBody] RegistrationModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var result = await this._authService.Register(model.ConvertToUser(), model.Password);

            if (result.IsSuccessful)
            {
                return(Ok());
            }
            else
            {
                return(BadRequest(result.ExceptionContentResult));
            }
        }