public async Task <ActionResult <RegisterUserViewModel> > Register([FromBody] RegisterUserViewModel model) { if (!ModelState.IsValid) { NotifyModelStateErrors(); return(ModelStateErrorResponseError()); } if (await _reCaptchaService.IsCaptchaEnabled()) { var captchaSucces = await _reCaptchaService.IsCaptchaPassed(); if (!captchaSucces) { await _mediator.RaiseEvent(new DomainNotification("Recatcha", "ReCaptcha failed")); return(BadRequest(new ValidationProblemDetails(_notifications.GetNotificationsByKey()))); } } if (model.ContainsFederationGateway()) { await _userAppService.RegisterWithProvider(model); } else { await _userAppService.Register(model); } model.ClearSensitiveData(); return(ResponsePost("UserData", "Account", null, model)); }
public async Task <ActionResult <RegisterUserViewModel> > Register([FromBody] RegisterUserViewModel model) { if (!ModelState.IsValid) { NotifyModelStateErrors(); return(ModelStateErrorResponseError()); } if (model.ContainsFederationGateway()) { await _userAppService.RegisterWithProvider(model); } else { await _userAppService.Register(model); } model.ClearSensitiveData(); return(ResponsePost("UserData", "Account", null, model)); }