-
Notifications
You must be signed in to change notification settings - Fork 0
[FIX] 카카오톡 미로그인 시 소셜로그인 안되는 현상 수정 #63
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
Conversation
- 카카오톡 앱으로 로그인을 시도하다가 실패하거나 사용자가 취소할 경우, 별도의 에러 메시지 없이 바로 카카오계정(웹) 로그인으로 전환되도록 로직을 개선했습니다. - 사용자가 로그인을 취소했을 때 발생하는 `ClientError`를 `KakaoUserCancelledException`으로 매핑하여 처리합니다.
Summary of ChangesHello @stopstone, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 PR은 카카오 소셜 로그인 과정에서 사용자 경험을 개선하는 것을 목표로 합니다. 기존에는 사용자가 카카오톡 앱에 로그인되어 있지 않거나 로그인 시도를 취소할 경우, 명확한 다음 단계 없이 오류가 발생할 수 있었습니다. 본 변경사항은 이러한 상황에서 자동으로 웹 기반 카카오 계정 로그인으로 전환하여 사용자가 중단 없이 로그인 절차를 완료할 수 있도록 합니다. 이는 불필요한 오류 메시지를 줄이고 로그인 흐름을 더욱 원활하게 만듭니다. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
안녕하세요. 카카오톡 로그인 실패 시 웹 로그인으로 전환하는 로직을 추가하여 사용자 경험을 개선한 점이 좋습니다. 또한, 에러 처리 로직을 개선하여 더 안정적인 로그인 흐름을 만든 점도 긍정적입니다.
리뷰에서는 두 가지 개선점을 제안했습니다. 첫째, PR 설명에 언급된 대로 사용자 취소 케이스에 대해 커스텀 예외(KakaoUserCancelledException)를 사용하여 보다 명시적인 에러 처리가 가능하도록 하는 것입니다. 둘째, 카카오 SDK의 명세상 발생하지 않아야 할 예외 케이스에 대해 IllegalStateException을 사용해 잠재적인 문제를 명확히 드러내도록 수정하는 것을 제안했습니다.
이러한 변경들을 통해 코드의 견고성과 유지보수성을 더욱 향상시킬 수 있을 것입니다. 수정 사항을 검토해 주셔서 감사합니다.
Near/app/src/main/java/com/alarmy/near/presentation/feature/login/auth/KakaoLoginManager.kt
Show resolved
Hide resolved
| else -> | ||
| continuation.resumeWith( | ||
| Result.failure( | ||
| Exception(context.getString(R.string.login_user_cancelled)), | ||
| ), | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handleLoginResult 함수의 when 표현식에서 token과 error가 모두 null인 else 분기는 카카오 SDK 명세상 발생해서는 안 되는 경우입니다. 현재 코드는 이 예외적인 상황을 사용자가 로그인을 취소한 것으로 간주하고 있는데, 이는 잠재적인 SDK 문제를 숨기고 디버깅을 어렵게 만들 수 있습니다.
이러한 예기치 않은 상태는 IllegalStateException과 같이 더 명확한 예외를 발생시켜 처리하는 것이 좋습니다. 이를 통해 개발 중에 문제를 더 빨리 파악하고 대응할 수 있습니다.
| else -> | |
| continuation.resumeWith( | |
| Result.failure( | |
| Exception(context.getString(R.string.login_user_cancelled)), | |
| ), | |
| ) | |
| else -> | |
| continuation.resumeWith( | |
| Result.failure( | |
| IllegalStateException("Kakao login returned null for both token and error"), | |
| ), | |
| ) |
작업 내용
별도의 에러 메시지 없이 바로 카카오계정(웹) 로그인으로 전환되도록 로직을 개선했습니다.
ClientError를KakaoUserCancelledException으로 매핑하여 처리합니다.확인 방법
KakaoLoginManager에서 확인하실 수 있습니다.
카카오톡을 설치후 로그인하지 않고 소셜로그인을 수행하면 wb으로 redirect됩니다.
관련 이슈