-
Notifications
You must be signed in to change notification settings - Fork 0
[feat/#8] kakao login #17
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
- DTO, Service, DataSource, Repository 구조 완성 - 카카오 SDK 연동 및 서버 통신 로직 - DataStore 기반 토큰 저장소 구현"
sonms
left a comment
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.
너무 고생많으셨습니다! Tink 까지 써보시다니 좋은데요? 우선은 이 정도 남기고 후추 추가적으로 더 남기겠습니다~!
app/src/main/java/com/kiero/data/auth/local/datasourceimpl/AuthLocalDataSourceImpl.kt
Outdated
Show resolved
Hide resolved
| private val Context.dataStore: DataStore<Preferences> by preferencesDataStore( | ||
| name = DATASTORE_NAME | ||
| ) |
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.
p1: context.datastore는 파일의 최상단에 두는 게 공식권장 사항으로 알고 있어요
DataStore는 싱글톤으로 유지되어야합니다
근데 해당 AuthLocalDataSourceImpl 안에 선언하면 클래스가 여러 번 생성되거나 다른 컨텍스트로 호출되면
같은 파일명 DATASTORE_NAME에 대해 인스턴스 충돌이 발생할 수 있을 것 같습니다
또한 다른 인스턴스로 생성 시 값이 중간에 유실되는 일관성? 에도 문제가 생기고 race condition도 생길 거 같네용
app/src/main/java/com/kiero/data/auth/local/datasourceimpl/AuthLocalDataSourceImpl.kt
Outdated
Show resolved
Hide resolved
seungjae708
left a comment
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.
고생하셨습니다!!
쉽지 않아보이는데 정리도 같이 하시면서 공부 열심히 하시고 적용하신게 느껴집니다.
저도 소셜로그인 처리를 안해봐서 코드랑 아티클 천천히 다시 보면서 공부해볼게요~
app/src/main/java/com/kiero/presentation/auth/parent/component/KakaoLoginButton.kt
Show resolved
Hide resolved
| interface AuthRepository { | ||
| suspend fun loginWithKakao(): Result<AuthLoginResponseDto> | ||
| suspend fun saveAuthTokens(accessToken: String, refreshToken: String) | ||
| } No newline at end of file |
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.
p3) AuthRepository가 Data Layer의 Dto를 직접 반환하고 있는데 Mapper를 넣는건 어떤가요?
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.
p3) 저희 첫.. 코리에 얘기해놓긴 했는데.. 전달이 안됐네요 하핫... Mapper 써도 되긴하는데, 확장함수 써서 좀 더 간편하게 변환 하기로 했습니다
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.
mapper 넣는거 생각도 해봤었는데, 저희가 프로필보여주는 화면도 없기도 하고 굳이 Token들을
매퍼로 변환할 이유가 없을 것 같아서 간편하게 변환했습니다 !
vvan2
left a comment
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.
고생하셨습니다~ 카카오 로그인 작업 잘해주셨네요 ㅎㅎ .
코드 리뷰는 이따 저녁에 더 달아볼게요
(규현쿤, 사실 나도 Tink 를 써본적 없어)
| data object NavigateUp : SideEffect | ||
| data object LoginSuccess : SideEffect | ||
| } | ||
| } |
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.
p2) state 와 sideEffect 분리해서 놨었는데 다시 객체로 묶어준 이유가 있을까요!
app/src/main/java/com/kiero/presentation/auth/KaKaoLoginScreen.kt
Outdated
Show resolved
Hide resolved
| interface AuthRepository { | ||
| suspend fun loginWithKakao(): Result<AuthLoginResponseDto> | ||
| suspend fun saveAuthTokens(accessToken: String, refreshToken: String) | ||
| } No newline at end of file |
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.
p3) 저희 첫.. 코리에 얘기해놓긴 했는데.. 전달이 안됐네요 하핫... Mapper 써도 되긴하는데, 확장함수 써서 좀 더 간편하게 변환 하기로 했습니다
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.
p2) DI 쪽은 제가 분리할 예정이긴 한데, (auth,kid,parent 각각 사용할 수 있게) 참고만 해주세용
sonms
left a comment
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.
고생많았습니다!!
vvan2
left a comment
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.
고생했다....
seungjae708
left a comment
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.
수고 많으셨습니다~!
카카오 로그인 구현
ISSUE
❗ WORK DESCRIPTION
0. 자세한 일기장
앙티클_카카오 왜이렇게 귀찮음 ?
local.properties
1. 카카오 SDK 초기화
KieroApplication에서 SDK 초기화AndroidManifest.xml에AuthCodeHandlerActivity등록2. Data Layer (Clean Architecture)
Remote DataSource
AuthDataSource인터페이스 정의AuthDataSourceImpl구현Local DataSource
AuthLocalDataSource인터페이스 정의AuthLocalDataSourceImpl구현Repository
AuthRepository인터페이스 정의AuthRepositoryImpl구현suspendRunCatching,handleError적용3. DI 모듈
ServiceModule:AuthService제공DataSourceModule:AuthDataSource,AuthLocalDataSource바인딩RepositoryModule:AuthRepository바인딩UtilModule:TinkEncryption제공4. UI Layer (MVVM 패턴)
AuthContract: State, SideEffect 정의AuthViewModel: 로그인 로직, 상태 관리KakaoLoginButton: 재사용 가능한 컴포넌트LoginScreen: 로그인 화면AuthNavigation: 역할 선택 → 로그인 흐름 추가5. 보안
TinkEncryption)6. CICD 대비 NATIVE_KEY GitSecret 저장
🔄 로그인 프로세스
📢 TO REVIEWERS
1. 보안 구현
TinkEncryption구현 방식 (현재는 Keystore 없이 Tink만 사용)2. 에러 처리
suspendRunCatching+handleError조합이 적절한지3. 아키텍처
loginWithKakao()→saveAuthTokens()별도 호출 필요4. 네이밍
AuthDataSource(Remote)와AuthLocalDataSource구분이 명확한지토큰 갱신 로직 왜 안했냐는 나쁜말은 ㄴㄴ
Tink 암호화 수준
💬 논의 필요한 부분
📸 SCREENSHOT
전체 로그
카카오톡 앱이 없을때 웹으로 넘어가는 모습
2026-01-10.14.56.19.mov
카카오로그인 성공
2026-01-10.15.51.37.mov