Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 모바일 토큰 발급 시 신규 계정 여부 추가 에러 #195

Merged
merged 4 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
public interface UserRepository extends JpaRepository<User, Long>, UserRepositoryCustom {
Optional<User> findByUsername(String username);

Optional<User> findByUsernameContaining(String usename);

User findByMentor(Mentor mentor);

User findByMentorIdWithFetch(Long mentorId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Loading