From 81cf22f342c9e17491587778a9503352f70086cb Mon Sep 17 00:00:00 2001 From: Fritz Seitz Date: Sat, 23 Nov 2024 21:38:46 -0500 Subject: [PATCH] fix: generalize exception as exceptions are being missed --- .../Controllers/AuthenticationController.cs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/Bulwark.Auth/Controllers/AuthenticationController.cs b/src/Bulwark.Auth/Controllers/AuthenticationController.cs index d19822a..6f332dc 100644 --- a/src/Bulwark.Auth/Controllers/AuthenticationController.cs +++ b/src/Bulwark.Auth/Controllers/AuthenticationController.cs @@ -30,7 +30,7 @@ public async Task> { return await _auth.Authenticate(payload.Email, payload.Password); } - catch(BulwarkAuthenticationException exception) + catch(Exception exception) { return Problem( title: "Bad Input", @@ -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", @@ -94,14 +94,6 @@ public async Task> 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( @@ -123,7 +115,7 @@ await _auth.Revoke(validate.Email, return NoContent(); } - catch (BulwarkTokenException exception) + catch (Exception exception) { return Problem( title: "Can not revoke",