diff --git a/src/main/java/com/chat/yourway/model/token/Token.java b/src/main/java/com/chat/yourway/model/token/Token.java index 44632fe7..013dbadc 100644 --- a/src/main/java/com/chat/yourway/model/token/Token.java +++ b/src/main/java/com/chat/yourway/model/token/Token.java @@ -16,14 +16,12 @@ @Setter @RedisHash("Token") public class Token { - @Id @Indexed public String email; @Indexed public String token; - public TokenType tokenType; + public String tokenType; public boolean revoked; public boolean expired; - -} +} \ No newline at end of file diff --git a/src/main/java/com/chat/yourway/model/token/TokenType.java b/src/main/java/com/chat/yourway/model/token/TokenType.java deleted file mode 100644 index 2ef14f81..00000000 --- a/src/main/java/com/chat/yourway/model/token/TokenType.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.chat.yourway.model.token; - -public enum TokenType { - BEARER -} diff --git a/src/main/java/com/chat/yourway/security/JwtAuthFilter.java b/src/main/java/com/chat/yourway/security/JwtAuthFilter.java index 0b332054..bacc89f6 100644 --- a/src/main/java/com/chat/yourway/security/JwtAuthFilter.java +++ b/src/main/java/com/chat/yourway/security/JwtAuthFilter.java @@ -35,8 +35,8 @@ public class JwtAuthFilter extends OncePerRequestFilter { @Override @SneakyThrows protected void doFilterInternal(@NonNull HttpServletRequest request, - @NonNull HttpServletResponse response, - @NonNull FilterChain filterChain) { + @NonNull HttpServletResponse response, + @NonNull FilterChain filterChain) { if (isNotAuthorizationHeader(request) && isNotTokenParameter(request)) { log.warn("Request without authorization. Header or parameter does not contain {}", AUTHORIZATION); diff --git a/src/main/java/com/chat/yourway/service/AuthenticationService.java b/src/main/java/com/chat/yourway/service/AuthenticationService.java index dc339b98..61ffe6bc 100644 --- a/src/main/java/com/chat/yourway/service/AuthenticationService.java +++ b/src/main/java/com/chat/yourway/service/AuthenticationService.java @@ -1,7 +1,5 @@ package com.chat.yourway.service; -import static com.chat.yourway.model.token.TokenType.*; - import com.chat.yourway.dto.request.AuthRequestDto; import com.chat.yourway.dto.request.ContactRequestDto; import com.chat.yourway.dto.request.EmailRequestDto; @@ -107,7 +105,7 @@ private void saveContactToken(String email, String jwtToken) { var token = Token.builder() .email(email) .token(jwtToken) - .tokenType(BEARER) + .tokenType("BEARER") .expired(false) .revoked(false) .build();