diff --git a/src/main/java/com/soongsil/CoffeeChat/config/jwt/JWTFilter.java b/src/main/java/com/soongsil/CoffeeChat/config/jwt/JWTFilter.java index f282e87..2363e2a 100644 --- a/src/main/java/com/soongsil/CoffeeChat/config/jwt/JWTFilter.java +++ b/src/main/java/com/soongsil/CoffeeChat/config/jwt/JWTFilter.java @@ -40,7 +40,7 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse if (path.startsWith("/health-check") || path.startsWith("/security-check") || path.startsWith("/auth/reissue") || path.startsWith("/login") || path.startsWith("/reissue") || path.matches("^/api/v2/mentors/\\d+$") || path.matches("^/api/v2/mentors/part$") || path.matches("/oauth2/authorization/google") - || path.matches("^/auth/issue/mobile$")) { + || path.startsWith("/auth/issue/mobile")) { System.out.println("jwt필터 통과로직"); filterChain.doFilter(request, response); return; diff --git a/src/main/java/com/soongsil/CoffeeChat/dto/MobileTokenResponseDTO.java b/src/main/java/com/soongsil/CoffeeChat/dto/MobileTokenResponseDTO.java index bcbdcb9..6d033fc 100644 --- a/src/main/java/com/soongsil/CoffeeChat/dto/MobileTokenResponseDTO.java +++ b/src/main/java/com/soongsil/CoffeeChat/dto/MobileTokenResponseDTO.java @@ -1,8 +1,12 @@ package com.soongsil.CoffeeChat.dto; import lombok.Builder; +import lombok.Getter; +import lombok.Setter; @Builder +@Setter +@Getter public class MobileTokenResponseDTO { private String accessToken; private String refreshToken; diff --git a/src/main/java/com/soongsil/CoffeeChat/repository/User/UserRepository.java b/src/main/java/com/soongsil/CoffeeChat/repository/User/UserRepository.java index 8f33e4b..dc25abe 100644 --- a/src/main/java/com/soongsil/CoffeeChat/repository/User/UserRepository.java +++ b/src/main/java/com/soongsil/CoffeeChat/repository/User/UserRepository.java @@ -11,6 +11,8 @@ public interface UserRepository extends JpaRepository, UserRepositoryCustom { Optional findByUsername(String username); + Optional findByUsernameContaining(String usename); + User findByMentor(Mentor mentor); User findByMentorIdWithFetch(Long mentorId); diff --git a/src/main/java/com/soongsil/CoffeeChat/service/CustomOAuth2UserService.java b/src/main/java/com/soongsil/CoffeeChat/service/CustomOAuth2UserService.java index 1ef894e..f23494d 100644 --- a/src/main/java/com/soongsil/CoffeeChat/service/CustomOAuth2UserService.java +++ b/src/main/java/com/soongsil/CoffeeChat/service/CustomOAuth2UserService.java @@ -116,7 +116,7 @@ public MobileTokenResponseDTO verifyGoogleToken(String accessToken, String name) .isNewAccount(false) .build(); - if(!userRepository.findByUsername(mobileUserDTO.getUsername()).isPresent()){ + if(!userRepository.findByUsernameContaining(mobileUserDTO.getUsername()).isPresent()){ mobileUserDTO.setNewAccount(true); }