diff options
Diffstat (limited to 'Controllers')
-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" }); |