Skip to content

Commit

Permalink
update: refactor project All
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladik-gif committed Oct 17, 2024
1 parent 10ba572 commit afe5721
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 14 deletions.
6 changes: 2 additions & 4 deletions src/main/java/com/chat/yourway/model/token/Token.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

}
}
5 changes: 0 additions & 5 deletions src/main/java/com/chat/yourway/model/token/TokenType.java

This file was deleted.

4 changes: 2 additions & 2 deletions src/main/java/com/chat/yourway/security/JwtAuthFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit afe5721

Please sign in to comment.