Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: 카카오로그인 에러 수정 (#51) #52

Merged
merged 2 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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());
}
}