Skip to content

[Feature/#3] kakao login sdk#4

Merged
leeseokchan00 merged 7 commits intodevelopfrom
feature/#3-kakao-login-sdk
Jun 23, 2025
Merged

[Feature/#3] kakao login sdk#4
leeseokchan00 merged 7 commits intodevelopfrom
feature/#3-kakao-login-sdk

Conversation

@leeseokchan00
Copy link
Copy Markdown
Contributor

@leeseokchan00 leeseokchan00 commented Jun 23, 2025

📌 PR 요약

🌱 작업한 내용

  • 카카오 로그인 sdk 연결

🌱 PR 포인트

  • "asdasd"로 로그 찍으면 액세스 ,리프레시 토큰 확인 할 수 있습니다.

📸 스크린샷

Screen_recording_20250624_030922.mp4

|파일첨부바람|

📮 관련 이슈

Summary by CodeRabbit

Summary by CodeRabbit

  • 신규 기능

    • 카카오 로그인을 위한 OAuth 기능이 추가되었습니다. 앱에서 카카오 계정으로 로그인할 수 있습니다.
    • OAuth 전용 화면 및 네비게이션이 도입되어, 앱 실행 시 최초 진입 화면이 OAuth로 변경되었습니다.
  • 기타

    • 카카오 SDK 및 관련 의존성, 네이티브 키 설정이 추가되었습니다.
    • 앱 빌드 및 설정 파일이 OAuth 기능에 맞게 업데이트되었습니다.

@leeseokchan00 leeseokchan00 requested a review from a team June 23, 2025 17:36
@leeseokchan00 leeseokchan00 self-assigned this Jun 23, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jun 23, 2025

"""

Walkthrough

카카오 로그인을 위한 SDK 연동 및 OAuth 기능이 신규로 추가되었습니다. 카카오 SDK 의존성, 네이티브 키의 빌드/매니페스트 연동, OAuth 전용 feature 모듈, OAuth 네비게이션 및 화면, ViewModel과 상태 관리, 카카오 로그인 플로우 코드가 포함되었습니다. 기존 네비게이션 진입점도 OAuth로 변경되었습니다.

Changes

파일/경로 그룹 변경 요약
app/build.gradle.kts, settings.gradle.kts, feature/main/build.gradle.kts, feature/oauth/build.gradle.kts 카카오 로그인 라이브러리 및 feature.oauth 모듈 의존성 추가, 모듈 등록, 카카오 저장소 추가
app/src/main/AndroidManifest.xml 카카오 인증 핸들러 Activity 추가, OAuth용 intent filter 및 scheme 등록
build-logic/convention/src/main/java/AndroidApplicationPlugin.kt, build-logic/convention/.../BuildConfig.kt 로컬 Gradle 프로퍼티에서 카카오 네이티브 키를 읽어 Manifest 및 BuildConfig에 연결
core/common/src/main/java/.../BuildConfigFields.kt, core/buildconfig/.../BuildConfigFieldsProviderImpl.kt BuildConfigFields에 kakaoNativeKey 필드 추가, 반환값에 포함
core/ui/src/main/java/.../LaunchedEffectWithLifecycle.kt Compose에서 라이프사이클에 맞춰 동작하는 LaunchedEffectWithLifecycle 함수 추가
feature/main/src/main/java/com/teamsolply/solply/main/MainNavigator.kt 앱 시작 네비게이션 목적지를 Home에서 Oauth로 변경
feature/main/src/main/java/com/teamsolply/solply/main/MainScreen.kt OAuth 네비게이션 그래프를 NavHost에 추가
feature/oauth/.gitignore, feature/oauth/src/main/AndroidManifest.xml OAuth feature 모듈에 .gitignore 및 빈 매니페스트 추가
feature/oauth/src/main/java/com/teamsolply/solply/oauth/navigation/OauthNavigation.kt Oauth 네비게이션 경로, NavController 확장, NavGraphBuilder 확장 함수 추가
feature/oauth/src/main/java/com/teamsolply/solply/oauth/presentation/OauthContract.kt OauthState, OauthIntent, OauthSideEffect 등 상태/인텐트/사이드이펙트 정의
feature/oauth/src/main/java/com/teamsolply/solply/oauth/presentation/OauthScreen.kt OauthRoute, OauthScreen, startKakaoLogin 함수 등 OAuth UI 및 카카오 로그인 플로우 구현
feature/oauth/src/main/java/com/teamsolply/solply/oauth/presentation/OauthViewModel.kt OauthViewModel 클래스 및 인텐트 처리 로직 추가

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant OauthScreen
    participant OauthViewModel
    participant KakaoSDK

    User->>OauthScreen: "Oauth" 클릭
    OauthScreen->>OauthViewModel: KakaoLoginClick 인텐트 전달
    OauthViewModel->>OauthScreen: StartKakaoLogin 사이드이펙트 발행
    OauthScreen->>KakaoSDK: startKakaoLogin() 호출
    alt KakaoTalk 설치됨
        KakaoSDK-->>OauthScreen: 로그인 성공/실패 콜백
    else KakaoTalk 미설치
        KakaoSDK-->>OauthScreen: 카카오 계정 로그인 콜백
    end
    OauthScreen->>User: 결과 토스트/로깅
Loading

Assessment against linked issues

Objective Addressed Explanation
카카오 로그인 SDK 연동 및 OAuth 기능 구현 (#3)
카카오 네이티브 키 빌드/매니페스트 연동 (#3)
OAuth feature 모듈 및 네비게이션 적용 (#3)
OAuth 화면, ViewModel, 상태관리, 카카오 로그인 플로우 구현 (#3)

Poem

( )
(_/) 카카오 토큰을 쥐고
( •_•) 토끼는 로그인 문을 두드려요!
/ >🍪 OAuth의 길을 새로 열며
"Kakao, 안녕?" 토스트와 함께
앱의 시작도 이제는 OAuth!
🥕
"""


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7e7161a and 8265da7.

📒 Files selected for processing (1)
  • .github/workflows/android-pull-request-ci.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/android-pull-request-ci.yml
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (1)
core/ui/src/main/java/com/teamsolply/solply/ui/lifecycle/LaunchedEffectWithLifecycle.kt (1)

11-18: Composable 함수 시그니처 및 기본값 설정
key1, key2 기본값과 minActiveStateSTARTED로 설정해 필요한 시점에만 액션이 실행되도록 잘 정의했습니다. 추가 키 확장성이 필요하다면 vararg 방식 도입을 고려하세요.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 59b9cfe and fdb43bf.

📒 Files selected for processing (19)
  • app/build.gradle.kts (1 hunks)
  • app/src/main/AndroidManifest.xml (1 hunks)
  • app/src/main/java/com/teamsolply/solply/SolplyApplication.kt (1 hunks)
  • build-logic/convention/src/main/java/AndroidApplicationPlugin.kt (2 hunks)
  • build-logic/convention/src/main/java/com/teamsolply/solply/convention/BuildConfig.kt (1 hunks)
  • core/buildconfig/src/main/java/com/teamsolply/solply/buildconfig/impl/BuildConfigFieldsProviderImpl.kt (1 hunks)
  • core/common/src/main/java/com/teamsolply/solply/common/buildconfig/BuildConfigFields.kt (1 hunks)
  • core/ui/src/main/java/com/teamsolply/solply/ui/lifecycle/LaunchedEffectWithLifecycle.kt (1 hunks)
  • feature/main/build.gradle.kts (1 hunks)
  • feature/main/src/main/java/com/teamsolply/solply/main/MainNavigator.kt (2 hunks)
  • feature/main/src/main/java/com/teamsolply/solply/main/MainScreen.kt (2 hunks)
  • feature/oauth/.gitignore (1 hunks)
  • feature/oauth/build.gradle.kts (1 hunks)
  • feature/oauth/src/main/AndroidManifest.xml (1 hunks)
  • feature/oauth/src/main/java/com/teamsolply/solply/oauth/navigation/OauthNavigation.kt (1 hunks)
  • feature/oauth/src/main/java/com/teamsolply/solply/oauth/presentation/OauthContract.kt (1 hunks)
  • feature/oauth/src/main/java/com/teamsolply/solply/oauth/presentation/OauthScreen.kt (1 hunks)
  • feature/oauth/src/main/java/com/teamsolply/solply/oauth/presentation/OauthViewModel.kt (1 hunks)
  • settings.gradle.kts (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build
🔇 Additional comments (24)
app/build.gradle.kts (1)

24-25: Kakao 로그인 SDK 의존성 추가 확인
app 모듈에 libs.kakao.login 의존성을 적절히 추가해 OAuth 기능을 연동했습니다. 문제 없어 보입니다.

settings.gradle.kts (2)

21-21: Kakao SDK용 Maven 저장소 추가
maven(url = "https://devrepo.kakao.com/nexus/content/groups/public/")dependencyResolutionManagement에 추가해 SDK를 올바르게 가져올 수 있도록 했습니다.


41-41: OAuth 모듈 포함 처리
include(":feature:oauth") 를 루트 프로젝트에 추가해 OAuth 모듈을 빌드 대상에 포함시켰습니다.

core/ui/src/main/java/com/teamsolply/solply/ui/lifecycle/LaunchedEffectWithLifecycle.kt (2)

3-10: 필요한 라이프사이클 및 Compose 임포트 확인
LaunchedEffect, LocalLifecycleOwner, repeatOnLifecycle 등 필요한 임포트가 모두 적절히 추가되어 있습니다.


19-24: repeatOnLifecycle 내부 로직 안전성 검토
repeatOnLifecycle 블록에서 action()을 호출해 라이프사이클 상태 변화에 따라 안전하게 코루틴을 재시작하도록 구현되었습니다.

feature/oauth/.gitignore (1)

1-1: 빌드 아티팩트 ignore 설정
/build 디렉토리를 무시해 모듈별 빌드 산출물이 커밋되지 않도록 했습니다.

feature/main/build.gradle.kts (1)

10-10: OAuth 모듈 의존성 추가
feature/main 모듈에 projects.feature.oauth 의존성을 추가해 OAuth 기능을 통합했습니다.

feature/oauth/src/main/AndroidManifest.xml (1)

1-4: 최소한의 매니페스트 구성이 적절합니다.

OAuth 피쳐 모듈의 매니페스트가 최소한으로 구성되어 있으며, 이는 피쳐 모듈의 모범 사례에 따른 올바른 접근입니다. OAuth 관련 Activity 및 권한은 앱 레벨 매니페스트에서 처리되므로 이 구성이 적합합니다.

feature/oauth/build.gradle.kts (1)

1-11: 빌드 구성이 올바르게 설정되었습니다.

OAuth 피쳐 모듈의 빌드 구성이 적절합니다:

  • solply.feature 플러그인 적용
  • 일관된 네임스페이스 명명 규칙
  • 카카오 로그인 라이브러리 의존성 추가

모든 설정이 Android 모듈 모범 사례를 따르고 있습니다.

app/src/main/java/com/teamsolply/solply/SolplyApplication.kt (2)

4-5: 카카오 SDK 초기화를 위한 import가 추가되었습니다.

카카오 SDK 초기화에 필요한 클래스들이 올바르게 import되었습니다.


12-13: 카카오 SDK 초기화가 올바르게 구현되었습니다.

Application의 onCreate()에서 카카오 SDK를 초기화하는 것이 적절한 위치입니다. 빌드 구성에서 네이티브 키를 가져와 사용하는 방식도 보안상 안전하고 구성 가능한 접근 방법입니다.

core/common/src/main/java/com/teamsolply/solply/common/buildconfig/BuildConfigFields.kt (1)

5-5: 카카오 네이티브 키 필드가 적절히 추가되었습니다.

kakaoNativeKey 필드가 기존 빌드 구성 필드들과 일관성을 유지하며 추가되었습니다. String 타입과 명명 규칙이 올바르며, 빌드 구성 시스템을 통한 카카오 SDK 연동을 지원합니다.

feature/main/src/main/java/com/teamsolply/solply/main/MainScreen.kt (2)

17-17: OAuth 네비게이션 그래프 import가 추가되었습니다.

OAuth 피쳐 모듈의 네비게이션 그래프를 사용하기 위한 import 문이 올바르게 추가되었습니다.


37-37: OAuth 네비게이션 그래프가 적절히 통합되었습니다.

NavHost에 OAuth 네비게이션 그래프가 추가되어 기존 홈 네비게이션과 함께 구성되었습니다. PaddingValues가 올바르게 전달되고 있으며, Jetpack Compose 네비게이션 모범 사례를 따르고 있습니다.

feature/main/src/main/java/com/teamsolply/solply/main/MainNavigator.kt (2)

13-13: OAuth 네비게이션 import가 올바르게 추가되었습니다.

새로운 OAuth 기능 모듈 연동을 위한 import가 적절히 추가되었습니다.


22-22: 앱 시작 화면이 OAuth로 변경되었습니다.

카카오 로그인 구현에 따라 앱의 시작 대상이 OAuth 화면으로 변경되었습니다. 이는 PR 목표와 일치하며 적절한 변경사항입니다.

build-logic/convention/src/main/java/AndroidApplicationPlugin.kt (1)

2-2: gradleLocalProperties import가 적절히 추가되었습니다.

매니페스트 플레이스홀더 설정을 위한 import가 올바르게 추가되었습니다.

core/buildconfig/src/main/java/com/teamsolply/solply/buildconfig/impl/BuildConfigFieldsProviderImpl.kt (2)

3-4: BuildConfig import가 적절히 개선되었습니다.

필요한 상수들만 선택적으로 import하여 깔끔한 코드 구조를 유지했습니다.


12-14: 카카오 네이티브 키 필드가 올바르게 추가되었습니다.

BuildConfigFields에 kakaoNativeKey 필드가 적절히 추가되어 기존 패턴과 일관성을 유지하고 있습니다.

app/src/main/AndroidManifest.xml (1)

20-33: 카카오 SDK OAuth Activity가 올바르게 구성되었습니다.

AuthCodeHandlerActivity 설정이 카카오 OAuth 플로우에 필요한 모든 요소를 포함하고 있습니다:

  • Intent filter가 VIEW 액션과 BROWSABLE 카테고리로 적절히 설정됨
  • 매니페스트 플레이스홀더를 사용하여 동적 스키마 구성
  • exported="true"로 외부 앱에서 접근 가능하도록 설정

이는 카카오 SDK 통합 가이드라인에 부합하는 올바른 구현입니다.

feature/oauth/src/main/java/com/teamsolply/solply/oauth/presentation/OauthViewModel.kt (1)

7-15: LGTM! MVI 패턴이 올바르게 구현되었습니다.

ViewModel이 BaseViewModel을 적절히 상속하고 있으며, Hilt를 통한 의존성 주입과 인텐트 처리 로직이 깔끔하게 구현되어 있습니다.

feature/oauth/src/main/java/com/teamsolply/solply/oauth/presentation/OauthContract.kt (1)

11-17: 인텐트와 사이드이펙트 정의가 적절합니다.

OauthIntentOauthSideEffect가 sealed interface로 적절히 정의되어 있으며, 카카오 로그인 플로우에 맞는 타입 안전한 구조를 제공합니다.

feature/oauth/src/main/java/com/teamsolply/solply/oauth/navigation/OauthNavigation.kt (1)

12-30: LGTM! Compose Navigation 패턴이 올바르게 구현되었습니다.

최신 Compose Navigation 패턴을 사용하여 type-safe navigation을 구현했습니다. @Serializable Route 객체와 확장 함수들이 적절히 정의되어 있습니다.

feature/oauth/src/main/java/com/teamsolply/solply/oauth/presentation/OauthScreen.kt (1)

58-75: UI 구성이 간단하고 명확합니다.

OAuth 화면의 UI가 간단하고 테스트 목적에 적합하게 구현되어 있습니다. customClickable 확장 함수를 사용하여 접근성도 고려되었습니다.

Comment on lines +17 to +21
buildConfigField(
"String",
"KAKAO_NATIVE_KEY",
gradleLocalProperties(rootDir, providers).getProperty("kakao.native.key")
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

카카오 네이티브 키 빌드 설정에 null 안전성 고려가 필요합니다.

로컬 properties에서 "kakao.native.key" 속성을 읽어오는데, 해당 속성이 존재하지 않을 경우 빌드 오류가 발생할 수 있습니다.

다음과 같이 기본값을 제공하는 것을 고려해보세요:

            buildConfigField(
                "String",
                "KAKAO_NATIVE_KEY",
-               gradleLocalProperties(rootDir, providers).getProperty("kakao.native.key")
+               "\"${gradleLocalProperties(rootDir, providers).getProperty("kakao.native.key") ?: ""}\""
            )
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
buildConfigField(
"String",
"KAKAO_NATIVE_KEY",
gradleLocalProperties(rootDir, providers).getProperty("kakao.native.key")
)
buildConfigField(
"String",
"KAKAO_NATIVE_KEY",
- gradleLocalProperties(rootDir, providers).getProperty("kakao.native.key")
+ "\"${gradleLocalProperties(rootDir, providers).getProperty("kakao.native.key") ?: ""}\""
)
🤖 Prompt for AI Agents
In
build-logic/convention/src/main/java/com/teamsolply/solply/convention/BuildConfig.kt
around lines 17 to 21, the code reads the "kakao.native.key" property without
null safety, which can cause build errors if the property is missing. Modify the
code to provide a default value when the property is not found, ensuring null
safety and preventing build failures. Use a safe call or an Elvis operator to
supply a fallback string like an empty string or a placeholder.

Comment on lines +7 to +9
data class OauthState(
val g: String = ""
) : UiState
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

플레이스홀더 프로퍼티를 제거하거나 의미있는 이름으로 변경하세요.

OauthStateg 프로퍼티는 의미가 불분명하며 실제로 사용되지 않는 것 같습니다. 불필요한 프로퍼티를 제거하거나 실제 필요한 상태를 나타내는 의미있는 이름으로 변경해야 합니다.

 data class OauthState(
-    val g: String = ""
+    // 필요한 경우 의미있는 상태 프로퍼티 추가
 ) : UiState
🤖 Prompt for AI Agents
In
feature/oauth/src/main/java/com/teamsolply/solply/oauth/presentation/OauthContract.kt
around lines 7 to 9, the OauthState data class has a property named 'g' which is
unclear and likely unused. Remove this placeholder property if it is
unnecessary, or rename it to a meaningful name that accurately represents the
state it holds to improve code clarity and maintainability.

Comment on lines +40 to +47
Log.d(
"asdasdasd",
"accessToken: ${accessToken}\n refreshToken: $refreshToken"
)
},
onFailure = { error ->
Log.d("asdasdasd", error.toString())
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

디버그 로그 태그를 의미있는 이름으로 변경하세요.

"asdasdasd" 같은 임시 로그 태그는 프로덕션 코드에 적합하지 않습니다. 의미있는 태그명을 사용하고, 민감한 토큰 정보 로깅을 고려해야 합니다.

                        Log.d(
-                            "asdasdasd",
+                            "OAUTH_LOGIN",
                            "accessToken: ${accessToken}\n refreshToken: $refreshToken"
                        )
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Log.d(
"asdasdasd",
"accessToken: ${accessToken}\n refreshToken: $refreshToken"
)
},
onFailure = { error ->
Log.d("asdasdasd", error.toString())
}
Log.d(
"OAUTH_LOGIN",
"accessToken: ${accessToken}\n refreshToken: $refreshToken"
)
},
onFailure = { error ->
Log.d("asdasdasd", error.toString())
}
🤖 Prompt for AI Agents
In
feature/oauth/src/main/java/com/teamsolply/solply/oauth/presentation/OauthScreen.kt
around lines 40 to 47, replace the placeholder log tag "asdasdasd" with a
meaningful and descriptive tag relevant to the OAuth screen or authentication
process. Additionally, remove or mask sensitive token information like
accessToken and refreshToken from the logs to avoid exposing confidential data.

Comment on lines +77 to +122
fun startKakaoLogin(
context: Context,
onSuccess: (accessToken: String, refreshToken: String?) -> Unit = { _, _ -> },
onFailure: (Throwable) -> Unit = {}
) {
val activity = context as? Activity ?: return

if (UserApiClient.instance.isKakaoTalkLoginAvailable(context)) {
UserApiClient.instance.loginWithKakaoTalk(activity) { token, error ->
if (error != null) {
if (error is ClientError && error.reason == ClientErrorCause.Cancelled) {
Toast.makeText(context, "로그인 취소", Toast.LENGTH_SHORT).show()
return@loginWithKakaoTalk
}
UserApiClient.instance.loginWithKakaoAccount(context) { accountToken, accountError ->
if (accountError != null) {
onFailure(accountError)
Toast.makeText(
context,
"로그인 실패: ${accountError.message}",
Toast.LENGTH_SHORT
).show()
return@loginWithKakaoAccount
}
if (accountToken != null) {
onSuccess(accountToken.accessToken, accountToken.refreshToken)
}
}
} else if (token != null) {
onSuccess(token.accessToken, token.refreshToken)
}
}
} else {
UserApiClient.instance.loginWithKakaoAccount(context) { token, error ->
Log.d("KAKAO_LOGIN", "loginWithKakaoAccount called. token=$token, error=$error")
if (error != null) {
onFailure(error)
Toast.makeText(context, "로그인 실패: ${error.message}", Toast.LENGTH_SHORT).show()
return@loginWithKakaoAccount
}
if (token != null) {
onSuccess(token.accessToken, token.refreshToken)
}
}
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

카카오 로그인 구현이 잘 되어 있지만 개선 사항이 있습니다.

카카오톡 앱 로그인과 계정 로그인의 분기 처리가 올바르게 구현되었습니다. 하지만 다음 개선사항을 고려해보세요:

  1. 문자열 하드코딩: 토스트 메시지들이 하드코딩되어 있습니다
  2. 로그 일관성: 일부 로그만 구체적인 태그를 사용합니다
  3. 토큰 보안: 액세스 토큰을 로그에 출력하는 것은 보안상 위험할 수 있습니다
                if (error is ClientError && error.reason == ClientErrorCause.Cancelled) {
-                    Toast.makeText(context, "로그인 취소", Toast.LENGTH_SHORT).show()
+                    Toast.makeText(context, context.getString(R.string.login_cancelled), Toast.LENGTH_SHORT).show()
                    return@loginWithKakaoTalk
                }
-            Log.d("KAKAO_LOGIN", "loginWithKakaoAccount called. token=$token, error=$error")
+            Log.d("OAUTH_LOGIN", "loginWithKakaoAccount called")
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
fun startKakaoLogin(
context: Context,
onSuccess: (accessToken: String, refreshToken: String?) -> Unit = { _, _ -> },
onFailure: (Throwable) -> Unit = {}
) {
val activity = context as? Activity ?: return
if (UserApiClient.instance.isKakaoTalkLoginAvailable(context)) {
UserApiClient.instance.loginWithKakaoTalk(activity) { token, error ->
if (error != null) {
if (error is ClientError && error.reason == ClientErrorCause.Cancelled) {
Toast.makeText(context, "로그인 취소", Toast.LENGTH_SHORT).show()
return@loginWithKakaoTalk
}
UserApiClient.instance.loginWithKakaoAccount(context) { accountToken, accountError ->
if (accountError != null) {
onFailure(accountError)
Toast.makeText(
context,
"로그인 실패: ${accountError.message}",
Toast.LENGTH_SHORT
).show()
return@loginWithKakaoAccount
}
if (accountToken != null) {
onSuccess(accountToken.accessToken, accountToken.refreshToken)
}
}
} else if (token != null) {
onSuccess(token.accessToken, token.refreshToken)
}
}
} else {
UserApiClient.instance.loginWithKakaoAccount(context) { token, error ->
Log.d("KAKAO_LOGIN", "loginWithKakaoAccount called. token=$token, error=$error")
if (error != null) {
onFailure(error)
Toast.makeText(context, "로그인 실패: ${error.message}", Toast.LENGTH_SHORT).show()
return@loginWithKakaoAccount
}
if (token != null) {
onSuccess(token.accessToken, token.refreshToken)
}
}
}
}
fun startKakaoLogin(
context: Context,
onSuccess: (accessToken: String, refreshToken: String?) -> Unit = { _, _ -> },
onFailure: (Throwable) -> Unit = {}
) {
val activity = context as? Activity ?: return
if (UserApiClient.instance.isKakaoTalkLoginAvailable(context)) {
UserApiClient.instance.loginWithKakaoTalk(activity) { token, error ->
if (error != null) {
if (error is ClientError && error.reason == ClientErrorCause.Cancelled) {
Toast.makeText(
context,
context.getString(R.string.login_cancelled),
Toast.LENGTH_SHORT
).show()
return@loginWithKakaoTalk
}
UserApiClient.instance.loginWithKakaoAccount(context) { accountToken, accountError ->
if (accountError != null) {
onFailure(accountError)
Toast.makeText(
context,
"로그인 실패: ${accountError.message}",
Toast.LENGTH_SHORT
).show()
return@loginWithKakaoAccount
}
if (accountToken != null) {
onSuccess(accountToken.accessToken, accountToken.refreshToken)
}
}
} else if (token != null) {
onSuccess(token.accessToken, token.refreshToken)
}
}
} else {
UserApiClient.instance.loginWithKakaoAccount(context) { token, error ->
Log.d("OAUTH_LOGIN", "loginWithKakaoAccount called")
if (error != null) {
onFailure(error)
Toast.makeText(
context,
"로그인 실패: ${error.message}",
Toast.LENGTH_SHORT
).show()
return@loginWithKakaoAccount
}
if (token != null) {
onSuccess(token.accessToken, token.refreshToken)
}
}
}
}
🤖 Prompt for AI Agents
In
feature/oauth/src/main/java/com/teamsolply/solply/oauth/presentation/OauthScreen.kt
between lines 77 and 122, the toast messages are hardcoded in Korean and should
be moved to string resources for localization support. Also, ensure all log
statements use a consistent and specific tag instead of generic ones. Finally,
remove or avoid logging access tokens or any sensitive token information to
prevent security risks.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/android-pull-request-ci.yml (1)

25-25: 네이밍 일관성: step 이름과 속성명 통일
현재 step 이름에서 kakaoNativeKey라고 표기되었으나, 실제로 생성되는 속성은 kakao.native.key입니다. step 이름을 속성명과 일치시키거나(예: kakao.native.key), 속성명을 camelCase로 변경해 네이밍을 통일하는 것이 좋습니다.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fdb43bf and e49d0ff.

📒 Files selected for processing (2)
  • .github/workflows/android-pull-request-ci.yml (1 hunks)
  • build-logic/convention/src/main/java/AndroidApplicationPlugin.kt (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • build-logic/convention/src/main/java/AndroidApplicationPlugin.kt
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build

@leeseokchan00 leeseokchan00 merged commit 4ec8ef0 into develop Jun 23, 2025
2 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Jun 25, 2025
@coderabbitai coderabbitai bot mentioned this pull request Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] 카카오 로그인 SDK

1 participant