From 337eaf148864382b68d5f9ea278b7d5abd6f592b Mon Sep 17 00:00:00 2001 From: hyxklee Date: Thu, 14 Nov 2024 13:45:22 +0900 Subject: [PATCH] =?UTF-8?q?HOTFIX:=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=EC=8B=9C=20customId=20=EB=B0=98=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/dto/response/UserSocialLoginResponse.java | 1 + .../com/leets/X/domain/user/service/UserService.java | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/leets/X/domain/user/dto/response/UserSocialLoginResponse.java b/src/main/java/com/leets/X/domain/user/dto/response/UserSocialLoginResponse.java index 12765c7..5c28634 100644 --- a/src/main/java/com/leets/X/domain/user/dto/response/UserSocialLoginResponse.java +++ b/src/main/java/com/leets/X/domain/user/dto/response/UserSocialLoginResponse.java @@ -8,6 +8,7 @@ public record UserSocialLoginResponse( Long id, LoginStatus status, + String customId, JwtResponse jwtToken ) { } diff --git a/src/main/java/com/leets/X/domain/user/service/UserService.java b/src/main/java/com/leets/X/domain/user/service/UserService.java index 3786a98..1b5d43d 100644 --- a/src/main/java/com/leets/X/domain/user/service/UserService.java +++ b/src/main/java/com/leets/X/domain/user/service/UserService.java @@ -100,8 +100,11 @@ public UserProfileResponse getProfile(String customId, String email){ private UserSocialLoginResponse loginUser(String email) { User user = find(email); - - return new UserSocialLoginResponse(user.getId(), LOGIN, generateToken(email)); + String customId = null; + if(user.getCustomId() != null){ + customId = user.getCustomId(); + } + return new UserSocialLoginResponse(user.getId(), LOGIN, customId, generateToken(email)); } private UserSocialLoginResponse registerUser(GoogleUserInfoResponse userInfo) { @@ -112,7 +115,7 @@ private UserSocialLoginResponse registerUser(GoogleUserInfoResponse userInfo) { userRepository.save(user); - return new UserSocialLoginResponse(user.getId(), REGISTER, generateToken(user.getEmail())); + return new UserSocialLoginResponse(user.getId(), REGISTER, null, generateToken(user.getEmail())); } private JwtResponse generateToken (String email){