From eb7b2ab6d7dc0c9ef74eecc9b6da23adf2adeb1d Mon Sep 17 00:00:00 2001 From: Rohan Sircar Date: Wed, 20 Nov 2019 15:16:03 +0530 Subject: [PATCH] added further logging to tokenauthfilter --- .../org/ros/chatto/security/TokenAuthenticationFilter.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/chatto/src/main/java/org/ros/chatto/security/TokenAuthenticationFilter.java b/chatto/src/main/java/org/ros/chatto/security/TokenAuthenticationFilter.java index 434b005..0dace30 100644 --- a/chatto/src/main/java/org/ros/chatto/security/TokenAuthenticationFilter.java +++ b/chatto/src/main/java/org/ros/chatto/security/TokenAuthenticationFilter.java @@ -29,7 +29,6 @@ import org.springframework.security.core.token.TokenService; import org.springframework.stereotype.Component; import org.springframework.web.filter.OncePerRequestFilter; - @Component public class TokenAuthenticationFilter extends OncePerRequestFilter { @@ -130,9 +129,9 @@ public class TokenAuthenticationFilter extends OncePerRequestFilter { throw new BadCredentialsException("User not found"); } - System.out.println("Timeout duration = " + tokenTimeoutDuration); + logger.info("Timeout duration = " + tokenTimeoutDuration); boolean isTokenExpired = isTokenExpired(userToken); - System.out.println("expired? " + isTokenExpired); + logger.info(String.format("Token for %s is expired? %s", userToken.getUserName(), isTokenExpired)); if (!isTokenExpired) { userToken.setCreationTime(Instant.now()); userTokenService.saveToken(userToken);