Skip to content

Commit

Permalink
fix: 모바일 토큰 발급 시 신규 계정 여부 추가 에러 (#195)
Browse files Browse the repository at this point in the history
* feat: 모바일 토큰 발급 시 신규 계정 여부 추가

* ref: mobile 유저 save 로직 원상복구

* fix: 모바일 토큰 발급 엔드포인트 jwt 필터에 추가
  • Loading branch information
qzzloz authored Dec 4, 2024
1 parent c686a38 commit 510b10b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
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

0 comments on commit 510b10b

Please sign in to comment.