Skip to content

Commit

Permalink
fix: generalize exception as exceptions are being missed
Browse files Browse the repository at this point in the history
  • Loading branch information
Fritz Seitz committed Nov 24, 2024
1 parent 3168762 commit 81cf22f
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/Bulwark.Auth/Controllers/AuthenticationController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public async Task<ActionResult<Authenticated>>
{
return await _auth.Authenticate(payload.Email, payload.Password);
}
catch(BulwarkAuthenticationException exception)
catch(Exception exception)
{
return Problem(
title: "Bad Input",
Expand Down Expand Up @@ -73,7 +73,7 @@ await _auth.Acknowledge(authenticated,
validate.Token, validate.DeviceId);
return token;
}
catch (BulwarkTokenException exception)
catch (Exception exception)
{
return Problem(
title: "Invalid Token",
Expand All @@ -94,14 +94,6 @@ public async Task<ActionResult<Authenticated>> RenewCredentials(RefreshToken pay

return authenticated;
}
catch (BulwarkTokenExpiredException exception)
{
return Problem(
title: "Refresh Expired Token",
detail: exception.Message,
statusCode: StatusCodes.Status422UnprocessableEntity
);
}
catch (BulwarkTokenException exception)
{
return Problem(
Expand All @@ -123,7 +115,7 @@ await _auth.Revoke(validate.Email,

return NoContent();
}
catch (BulwarkTokenException exception)
catch (Exception exception)
{
return Problem(
title: "Can not revoke",
Expand Down

0 comments on commit 81cf22f

Please sign in to comment.