Skip to content

Commit

Permalink
Merge pull request #11 from Team-Wable/fix/#10-kakao-auth
Browse files Browse the repository at this point in the history
fix : kakao auth
  • Loading branch information
Hong0329 authored Aug 16, 2024
2 parents 7d97a53 + b5bbefb commit 161e2ac
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
public class SocialInfoDto {
private String id;
private String nickname;
private String profileUrl;
// private String profileUrl;
private String email;
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ private SocialInfoDto getAppleSocialData(String socialAccessToken, String userNa
String appleId = userInfoObject.get("sub").getAsString();
String email = userInfoObject.get("email").getAsString();

return new SocialInfoDto(appleId, userName, null, email);
// return new SocialInfoDto(appleId, userName, null, email);
return new SocialInfoDto(appleId, userName, email);
} catch (NoSuchAlgorithmException | InvalidKeySpecException e) {
throw new BaseException(HttpStatus.INTERNAL_SERVER_ERROR, "애플 계정 데이터 가공 실패");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ private SocialInfoDto getKakaoSocialData(String socialAccessToken) {

JsonNode jsonNode = objectMapper.readTree(responseData.getBody());

String nickname = jsonNode.get("kakao_account").get("profile").get("nickname").asText();
String profileUrl = jsonNode.get("kakao_account").get("profile").get("profile_image_url").asText();
// String nickname = jsonNode.get("kakao_account").get("profile").get("nickname").asText();
// String profileUrl = jsonNode.get("kakao_account").get("profile").get("profile_image_url").asText();
String kakaoId = jsonNode.get("id").asText();
String email = jsonNode.get("kakao_account").get("email").asText();
// String email = jsonNode.get("kakao_account").get("email").asText();

return new SocialInfoDto(kakaoId, nickname, profileUrl,email);
// return new SocialInfoDto(kakaoId, nickname, profileUrl,email);
return new SocialInfoDto(kakaoId, "신규 유저","신규 유저");
} catch (JsonProcessingException e) {
throw new BaseException(HttpStatus.INTERNAL_SERVER_ERROR, "카카오 계정 데이터 가공 실패");
}
Expand Down

0 comments on commit 161e2ac

Please sign in to comment.