diff --git a/src/main/java/com/uid2/shared/attest/JwtService.java b/src/main/java/com/uid2/shared/attest/JwtService.java index dd822dbd..b27105ea 100644 --- a/src/main/java/com/uid2/shared/attest/JwtService.java +++ b/src/main/java/com/uid2/shared/attest/JwtService.java @@ -84,15 +84,15 @@ public JwtValidationResponse validateJwt(String jwt, String audience, String iss // return the first verified response return response; - } catch (TokenVerifier.VerificationException e) { - LOGGER.info("Error validating JWT. Error message: {}", e.getMessage()); - lastException = e; } catch (Exception e) { - LOGGER.warn("Error thrown verifying token", e); lastException = e; } } + if (!response.getIsValid()) { + LOGGER.error("Error validating JWT", lastException); + } + response.setValidationException(lastException); return response; }