From 646e5e66b4ad11c4018c20bd2f8f0596d3023d02 Mon Sep 17 00:00:00 2001 From: Dominic Villemure Date: Sat, 7 Sep 2024 10:55:46 -0400 Subject: [PATCH] Small fix on user creation --- src/Infrastructure/Identity/IdentityService.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Infrastructure/Identity/IdentityService.cs b/src/Infrastructure/Identity/IdentityService.cs index 6cf9a0f..6195a70 100644 --- a/src/Infrastructure/Identity/IdentityService.cs +++ b/src/Infrastructure/Identity/IdentityService.cs @@ -79,6 +79,11 @@ public class IdentityService( var response = await userManager.CreateAsync(applicationUser, password); + if (!response.Succeeded) + { + throw new BadHttpRequestException(response.Errors.First().Description); + } + var result = new Result(applicationUser.Id, response.Succeeded, response.ToApplicationResult().Errors); return result;