public async Task <IActionResult> Register([FromBody] AgencyRequest requested) { IdentityResult registration_attempt = await _agency.ClaimAgencyAsync(requested); if (registration_attempt != IdentityResult.Success) { return(BadRequest(registration_attempt)); } S4Identity agency = await _user_manager.FindByEmailAsync(requested.email); if (agency == null) { return(BadRequest("error locating new account")); } var signin_result = await _signin_manager.PasswordSignInAsync( agency, requested.password, false, false); if (signin_result == Microsoft.AspNetCore.Identity.SignInResult.Failed) { return(BadRequest(signin_result)); } return(new OkObjectResult(registration_attempt)); }
public void AddCurrent2Agency(AgencyRequest request) { var error = ProjectRepository.AddAgencyToTIPProject(request.ProjectVersionId, request.AgencyId, false); CheckError(error); }
public void DropCurrent2Agency(AgencyRequest request) { var error = ProjectRepository.DropAgencyFromTIP(request.ProjectVersionId, request.AgencyId); CheckError(error); }