diff options
author | HombreLaser <sebastian-440@live.com> | 2022-11-16 22:16:18 -0600 |
---|---|---|
committer | HombreLaser <sebastian-440@live.com> | 2022-11-16 22:16:18 -0600 |
commit | 43dcc633eb9630709569fca1f6ccdef1c698cb3b (patch) | |
tree | d6d2db8be33ee9e8da83045e90b2c6330c83e54c | |
parent | d9811fb5fca308d4cd3eb0039627c1182472069a (diff) |
-rw-r--r-- | Controllers/UsersController.cs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Controllers/UsersController.cs b/Controllers/UsersController.cs index 9e66fce..7aba69e 100644 --- a/Controllers/UsersController.cs +++ b/Controllers/UsersController.cs @@ -32,6 +32,10 @@ namespace IdentityAPI.Controllers { if(result.Succeeded) return Ok(new { Token = GenerateToken(user) }); + + var errors = from error in result.Errors select error.Description; + + return StatusCode(422, new { errorMessages = errors }); } return StatusCode(422, new { error = "The provided user is invalid" }); |