Browse Source

Removed handling of SecurityTokenValidationException

Auth/pm-6333/remove-security-validation-exception
Todd Martin 2 years ago
parent
commit
b5bd4d1d48
No known key found for this signature in database
GPG Key ID: 663E7AF5C839BC8F
  1. 5
      src/Api/Utilities/ExceptionHandlerFilterAttribute.cs
  2. 5
      src/SharedWeb/Utilities/ExceptionHandlerFilterAttribute.cs

5
src/Api/Utilities/ExceptionHandlerFilterAttribute.cs

@ -82,11 +82,6 @@ public class ExceptionHandlerFilterAttribute : ExceptionFilterAttribute @@ -82,11 +82,6 @@ public class ExceptionHandlerFilterAttribute : ExceptionFilterAttribute
errorMessage = "Resource not found.";
context.HttpContext.Response.StatusCode = 404;
}
else if (exception is SecurityTokenValidationException)
{
errorMessage = "Invalid token.";
context.HttpContext.Response.StatusCode = 403;
}
else if (exception is UnauthorizedAccessException)
{
errorMessage = "Unauthorized.";

5
src/SharedWeb/Utilities/ExceptionHandlerFilterAttribute.cs

@ -59,11 +59,6 @@ public class ExceptionHandlerFilterAttribute : ExceptionFilterAttribute @@ -59,11 +59,6 @@ public class ExceptionHandlerFilterAttribute : ExceptionFilterAttribute
errorMessage = "Resource not found.";
context.HttpContext.Response.StatusCode = 404;
}
else if (exception is SecurityTokenValidationException)
{
errorMessage = "Invalid token.";
context.HttpContext.Response.StatusCode = 403;
}
else if (exception is UnauthorizedAccessException)
{
errorMessage = "Unauthorized.";

Loading…
Cancel
Save