removed printstacktrace

This commit is contained in:
Sukalpo Mitra 2023-11-15 08:56:32 +08:00
parent 8196eb3815
commit b2b7dc2cb7

View File

@ -40,7 +40,7 @@ import static java.util.Optional.ofNullable;
public class JwtBasedSecurityFilter extends SecurityFilter { public class JwtBasedSecurityFilter extends SecurityFilter {
private static final Logger log = LoggerFactory.getLogger(JwtBasedSecurityFilter.class); private static final Logger log = LoggerFactory.getLogger(JwtBasedSecurityFilter.class);
/** /**
* Name of the cookie used to store the authentication token. * Name of the header used to store the authentication token.
*/ */
public static final String HEADER_NAME = "Authorization"; public static final String HEADER_NAME = "Authorization";
@ -82,18 +82,15 @@ public class JwtBasedSecurityFilter extends SecurityFilter {
return Boolean.TRUE; return Boolean.TRUE;
} catch (CertificateException e) { } catch (CertificateException e) {
//if CertificateException comes from buildJWTVerifier() //if CertificateException comes from buildJWTVerifier()
log.info("InValid TOKEN"); log.info("InValid TOKEN: " + e.getMessage());
e.printStackTrace();
return Boolean.FALSE; return Boolean.FALSE;
} catch (JWTVerificationException e) { } catch (JWTVerificationException e) {
// if JWT Token in invalid // if JWT Token in invalid
log.info("InValid TOKEN"); log.info("InValid TOKEN: " + e.getMessage() );
e.printStackTrace();
return Boolean.FALSE; return Boolean.FALSE;
} catch (Exception e) { } catch (Exception e) {
// If any other exception comes // If any other exception comes
log.info("InValid TOKEN, Exception Occurred"); log.info("InValid TOKEN, Exception Occurred: " + e.getMessage());
e.printStackTrace();
return Boolean.FALSE; return Boolean.FALSE;
} }
} }