From 25f55a62621787efa9408c7274ec8d8432036bf7 Mon Sep 17 00:00:00 2001 From: Rohan Sircar Date: Tue, 19 Nov 2019 20:50:15 +0530 Subject: [PATCH] some optimizations --- chatto/src/main/java/org/ros/chatto/logged/LoggedUser.java | 3 ++- .../org/ros/chatto/security/TokenAuthenticationFilter.java | 3 --- chatto/src/main/resources/application.properties | 4 +++- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/chatto/src/main/java/org/ros/chatto/logged/LoggedUser.java b/chatto/src/main/java/org/ros/chatto/logged/LoggedUser.java index 6e31759..e3e22f6 100644 --- a/chatto/src/main/java/org/ros/chatto/logged/LoggedUser.java +++ b/chatto/src/main/java/org/ros/chatto/logged/LoggedUser.java @@ -26,7 +26,7 @@ import lombok.Setter; @Setter public class LoggedUser implements HttpSessionBindingListener { - private String username; + private final String username; private UserService userService; private UserTokenService userTokenService; @@ -37,6 +37,7 @@ public class LoggedUser implements HttpSessionBindingListener { } public LoggedUser() { + username = null; } @Override 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 1276b00..2e9e867 100644 --- a/chatto/src/main/java/org/ros/chatto/security/TokenAuthenticationFilter.java +++ b/chatto/src/main/java/org/ros/chatto/security/TokenAuthenticationFilter.java @@ -28,9 +28,6 @@ import org.springframework.web.filter.GenericFilterBean; @Component public class TokenAuthenticationFilter extends GenericFilterBean { - @Autowired - private TokenRepository tokenRepository; - @Autowired private UserTokenService userTokenService; diff --git a/chatto/src/main/resources/application.properties b/chatto/src/main/resources/application.properties index 24bf0ae..64e4e4c 100644 --- a/chatto/src/main/resources/application.properties +++ b/chatto/src/main/resources/application.properties @@ -24,4 +24,6 @@ spring.jackson.serialization.write-dates-as-timestamps=false #spring.cache.type=ehcache3 spring.cache.jcache.config=classpath:ehcache.xml logging.level.org.springframework.cache = DEBUG -#test.bindAddress=192.168.1.106 \ No newline at end of file +#test.bindAddress=192.168.1.106 + +chatto.token.timeout-duration=10_000 \ No newline at end of file