Skip to content

Commit

Permalink
๐Ÿ› bugfix: client Id ์ˆ˜์ • ๋ฐ OauthService ๋กœ์ง ๊ฐœ์„  #158
Browse files Browse the repository at this point in the history
  • Loading branch information
jun02160 committed Apr 16, 2024
1 parent bf1be17 commit 2eb5e24
Showing 1 changed file with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,24 @@ public LoginResult login(OauthTokenCommand tokenRequest) {
OAuthPlatformMemberResult applePlatformMember = appleLoginService.getApplePlatformMember(tokenRequest.accessToken());

List<User> userEntity = userRetriever.getUsersBySocialId(applePlatformMember.platformId());
log.info("userEntity: {}", userEntity.size());

User user;
//์ฒ˜์Œ ๋กœ๊ทธ์ธ ํ•˜๊ฑฐ๋‚˜ ํƒˆํ‡ดํ•œ ๊ฒฝ์šฐ -> ํšŒ์›๊ฐ€์ž…
if (userEntity == null || isWithdrawn(userEntity)) {
User user = saveUser(null, applePlatformMember.platformId(), socialPlatform, tokenRequest, refreshToken);
if (userEntity.isEmpty() || isWithdrawn(userEntity)) {
user = saveUser(null, applePlatformMember.platformId(), socialPlatform, tokenRequest, refreshToken);
}
userEntity = userRetriever.getUsersBySocialId(applePlatformMember.platformId());
user = userEntity.get(0);

//๋กœ๊ทธ์ธ
updateRefreshToken(user, refreshToken);
String accessToken = jwtTokenProvider.createAccessToken(new UserAuthentication(user.getId(),null,null));
//๋กœ๊ทธ์ธ
updateRefreshToken(user, refreshToken);
String accessToken = jwtTokenProvider.createAccessToken(new UserAuthentication(user.getId(),null,null));

boolean isFinishedOnboarding = healthRetriever.existsHealthByUser(user);
boolean isMatched = user.getParentchild() != null && user.getParentchild().isMatched();
boolean isFinishedOnboarding = healthRetriever.existsHealthByUser(user);
boolean isMatched = user.getParentchild() != null && user.getParentchild().isMatched();

return LoginResult.of(user, accessToken, refreshToken, isFinishedOnboarding, isMatched);
}
return LoginResult.of(user, accessToken, refreshToken, isFinishedOnboarding, isMatched);
}
throw new UserException(INVALID_SOCIAL_PLATFORM);
}
Expand Down

0 comments on commit 2eb5e24

Please sign in to comment.