Skip to content

Commit

Permalink
develop: Log errors
Browse files Browse the repository at this point in the history
  • Loading branch information
galales committed May 6, 2024
1 parent aa4289f commit 97965a5
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
import java.security.spec.X509EncodedKeySpec;
import java.util.Base64;
import io.jsonwebtoken.Jwts;
import java.util.logging.Logger;

public class SecurityUtil {

private static final Logger logger = Logger.getLogger(SecurityUtil.class.getName());

public static boolean checkJwtValid(String authorizationHeader, String pKey) {

try {
Expand All @@ -26,6 +29,7 @@ public static boolean checkJwtValid(String authorizationHeader, String pKey) {

Jwts.parserBuilder().setSigningKey(publicKey).build().parseClaimsJws(authTrimmed);
} catch (Exception e) {
logger.warning("Exception: " + e.getMessage());
return false;
}
return true;
Expand Down

0 comments on commit 97965a5

Please sign in to comment.