Skip to content

Commit

Permalink
HOTFIX: 로그인 시 customId 반환
Browse files Browse the repository at this point in the history
  • Loading branch information
hyxklee committed Nov 14, 2024
1 parent caf98f9 commit 337eaf1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
public record UserSocialLoginResponse(
Long id,
LoginStatus status,
String customId,
JwtResponse jwtToken
) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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){
Expand Down

0 comments on commit 337eaf1

Please sign in to comment.