token auth filter now only catches badcredentialsexception instead of all exceptions. This prevents it from absorbing ALL exception stacktraces

This commit is contained in:
Rohan Sircar 2019-11-26 11:47:25 +05:30
parent 493d3cd079
commit ea4b2eb1b1

View File

@ -110,7 +110,7 @@ public class TokenAuthenticationFilter extends OncePerRequestFilter {
filterChain.doFilter(request, response);
}
catch (Exception e) {
catch (BadCredentialsException e) {
response.setHeader(HttpHeaders.CONTENT_TYPE, MediaType.TEXT_PLAIN_VALUE);
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
// response.sendError(HttpServletResponse.SC_BAD_REQUEST, e.getMessage());