[Feat] OAuth Provider와 login API 연동 - #49
Open
oungsi2000 wants to merge 6 commits into
Open
Conversation
OAuthCredential을 이용한 로그인 기능을 추가한다. 서버 응답인 LoginResponse를 LoginResult 도메인 모델로 변환하며, 신규 회원 여부(newMember)와 온보딩 토큰을 포함해 로그인 이후의 온보딩 진입 로직을 처리할 수 있도록 한다. * RemoteAuthDataSource 인터페이스에 login 메서드 추가 * LoginRequest, LoginResponse DTO 및 LoginResult 도메인 모델 정의 * Ktor를 사용한 로그인 API 호출 및 예외 처리 구현
코루틴의 구조적 동시성을 유지하기 위해 `CancellationException`을 재투척하는 `runCatchingCancellable` 유틸리티를 추가하고 이를 리포지토리에 적용한다. 기존 `runCatching`은 취소 예외까지 잡아버려 코루틴 취소를 방해하는 문제가 있다. - `AuthRepository` 및 구현체 추가: 원격 서버 로그인을 수행한다. - `LoginUseCase` 추가: 로그인 성공 시 발급된 토큰을 `TokenRepository`에 저장하는 로직을 결합한다. - `TokenRepositoryImpl`: 안전한 예외 처리를 위해 `runCatching`을 `runCatchingCancellable`로 교체한다.
RemoteAuthDataSource에서 로그인 요청 시 LoginRequest를 바디에 실어 보낸다. 신규 가입 등 토큰이 없는 상태를 지원하기 위해 LoginResult의 토큰 필드를 nullable로 변경하고, LoginUseCase에서는 유효한 토큰이 반환된 경우에만 저장하도록 수정한다. 추가로 DTO의 필드명을 서버 사양에 맞춰 isNewMember로 변경하고 매핑 로직을 업데이트한다. Co-Authored-By: Claude 3.5 Sonnet <noreply@anthropic.com>
RepositoryModule에서 AuthRepositoryImpl을 AuthRepository 인터페이스에 바인딩한다. NetworkModule의 provideAuthenticatedClient에서 사용되지 않는 HttpClientEngine 파라미터를 제거한다.
RemoteAuthDataSource의 Fake 객체를 추가하고 로그인 시나리오를 검증한다. 일반적인 예외는 Result.failure로 캡슐화하여 반환하지만, CancellationException은 코루틴 취소 메커니즘을 방해하지 않도록 그대로 전파해야 한다.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
데이터 소스 계층의 메서드 이름을 명확하게 하기 위해 postLogin으로 수정한다. 인터페이스 변경에 따라 구현체와 테스트용 페이크 객체를 함께 업데이트하고, AuthRepositoryImpl에서 사용하지 않는 LocalTokenDataSource 임포트를 제거한다.
Moony-H
approved these changes
Jul 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
관련 이슈
#36
작업 내용
변경사항 / 상세
MainActivity에서 이런 코드를 작성하여 테스트 하였습니다
중점 리뷰사항
스크린샷 (선택)