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

Conversation

win-luck
Copy link
Contributor

@win-luck win-luck commented Nov 6, 2023

  • 타임리프를 통해 클라이언트 입장에서의 카카오로그인을 실제로 시도
image
  • 프사 url에 대해 접근 시 return 과정에서 NullPointerException 발생
  • 확인 결과 서버에 accessToken을 전송했을 때 반환 JSON은 아래와 같았음
{
    "id": Long,
    "connected_at": "string",
    "properties": {
        "nickname": "string",
        "profile_image": "string",
        "thumbnail_image": "string"
    },
    "kakao_account": {
        "profile_nickname_needs_agreement": false,
        "profile_image_needs_agreement": false,
        "profile": {
            "nickname": "string",
            "thumbnail_image_url": "string",
            "profile_image_url": "string",
            "is_default_image": false
        }
    }
}
  • 초기 설정한 Dto는 카멜 케이스였고, 카카오 서버에서 반환하는 JSON은 스네이크 케이스
  • getter에서 표현의 차이로 미스매칭이 발생
  • Dto를 모두 스네이크 케이스로 통일
  • /api/auth/join 실행 시 성공적으로 동작하는 것을 확인함
{
    "header": {
        "code": 200,
        "message": "SUCCESS"
    },
    "data": {
        "1": "string"
    },
    "msg": "사용자 생성 성공"
}

@win-luck win-luck added the fix 버그 및 오류 수정 label Nov 6, 2023
@win-luck win-luck requested a review from synoti21 November 6, 2023 14:11
@win-luck win-luck self-assigned this Nov 6, 2023
@win-luck win-luck linked an issue Nov 6, 2023 that may be closed by this pull request
@synoti21
Copy link
Contributor

synoti21 commented Nov 6, 2023

수고하셨습니다~

@synoti21 synoti21 merged commit 2e47d59 into master Nov 6, 2023
1 check passed
@synoti21 synoti21 deleted the feature/51-fix-kakao branch November 6, 2023 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix 버그 및 오류 수정
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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