Skip to content

Commit

Permalink
Merge pull request #52 from CAUSOLDOUTMEN/feature/51-fix-kakao
Browse files Browse the repository at this point in the history
�Fix: 카카오로그인 에러 수정 (#51)
  • Loading branch information
synoti21 authored Nov 6, 2023
2 parents d7fe019 + 291ee2c commit 2e47d59
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/main/java/com/diareat/diareat/auth/dto/KakaoAccount.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
@Getter
public class KakaoAccount {

private Boolean profile_nickname_needs_agreement;
private Boolean profile_image_needs_agreement;
private KakaoProfile profile;
}
6 changes: 3 additions & 3 deletions src/main/java/com/diareat/diareat/auth/dto/KakaoProfile.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
public class KakaoProfile {

private String nickname;
private String profileImageUrl;
private String thumbnailImageUrl;
private boolean isDefaultImage;
private String thumbnail_image_url;
private String profile_image_url;
private Boolean is_default_image;
}
11 changes: 11 additions & 0 deletions src/main/java/com/diareat/diareat/auth/dto/KakaoProperties.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.diareat.diareat.auth.dto;

import lombok.Getter;

@Getter
public class KakaoProperties {

private String nickname;
private String profile_image;
private String thumbnail_image;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
public class KakaoUserInfoResponse {

private Long id;
private boolean hasSignedUp;
private KakaoAccount kakaoAccount;
private String connected_at;
private KakaoProperties properties;
private KakaoAccount kakao_account;
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public Long isSignedUp(String token) { // 클라이언트가 보낸 token을 이
@Transactional(readOnly = true)
public CreateUserDto createUserDto(JoinUserDto joinUserDto) { // 카카오로부터 프사 URL, 유저 고유ID를 얻어온 후, 이를 유저가 입력한 정보와 함께 CreateUserDto로 반환
KakaoUserInfoResponse userInfo = kakaoUserInfo.getUserInfo(joinUserDto.getToken());
return CreateUserDto.of(joinUserDto.getNickName(), userInfo.getKakaoAccount().getProfile().getProfileImageUrl(),
return CreateUserDto.of(joinUserDto.getNickName(), userInfo.getKakao_account().getProfile().getProfile_image_url(),
userInfo.getId().toString(), joinUserDto.getGender(), joinUserDto.getHeight(), joinUserDto.getWeight(), joinUserDto.getAge());
}
}

0 comments on commit 2e47d59

Please sign in to comment.