于紫祥_1901
2020-08-12 3ea1e97b2a6d3304aed2e76097e2dc1bc4c42c61
src/main/java/com/moral/security/auth/login/LoginAwareAuthenticationFailureHandler.java
@@ -49,8 +49,9 @@
         mapper.writeValue(response.getWriter(), ErrorResponse.of("Token has expired", ErrorCode.JWT_TOKEN_EXPIRED, HttpStatus.UNAUTHORIZED));
      } else if (e instanceof AuthMethodNotSupportedException) {
          mapper.writeValue(response.getWriter(), ErrorResponse.of(e.getMessage(), ErrorCode.AUTHENTICATION, HttpStatus.UNAUTHORIZED));
      }  else {
         mapper.writeValue(response.getWriter(), ErrorResponse.of(e.getMessage(), ErrorCode.AUTHENTICATION, HttpStatus.OK));
      }
//      mapper.writeValue(response.getWriter(), ErrorResponse.of("Authentication failed", ErrorCode.AUTHENTICATION, HttpStatus.UNAUTHORIZED));
      mapper.writeValue(response.getWriter(), ErrorResponse.of(e.getMessage(), ErrorCode.AUTHENTICATION, HttpStatus.UNAUTHORIZED));
   }
}