Refactor/#763#771
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 78a1ff9335
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| open url: URL, | ||
| options: [UIApplication.OpenURLOptionsKey: Any] = [:] | ||
| ) -> Bool { | ||
| GoogleSignInURLHandler.handle(url) |
There was a problem hiding this comment.
Google 콜백을 scene URL 경로에서 처리하세요
UIApplicationSceneManifest와 SwiftUI WindowGroup을 사용하는 이 앱에서는 기존 scene으로 돌아오는 OAuth URL이 UIApplicationDelegate.application(_:open:options:)가 아니라 scene의 .onOpenURL로 전달됩니다. 현재 RootView.swift의 핸들러는 해당 URL을 widget deep link로만 검사한 뒤 반환하므로, REVERSED_CLIENT_ID 콜백에서 GIDSignIn.sharedInstance.handle이 호출되지 않아 signIn(withPresenting:)가 완료되지 않습니다. App이 소유한 SwiftUI URL 진입점에서 GoogleSignInURLHandler로 전달해야 합니다. .agents/rules/architecture.mdL165-L165
Useful? React with 👍 / 👎.
| } | ||
|
|
||
| try Auth.auth().signOut() | ||
| GIDSignIn.sharedInstance.signOut() |
There was a problem hiding this comment.
GIDSignIn.sharedInstance.signOut()은 AuthenticationRepositoryImpl.signOut()이 Firestore의 currentProvider로 Google을 선택했을 때만 실행됩니다. 이 저장소가 지원하는 것처럼 Apple 또는 GitHub가 현재 provider이고 Google이 연결된 상태에서는 link()가 영속적인 GID 세션을 만들지만 일반 로그아웃은 해당 provider의 서비스만 호출하므로 이 정리가 누락됩니다. 그 결과 앱에서 로그아웃한 뒤에도 이전 Google 계정 세션이 남아 다음 Google 인증이 이전 사용자의 상태에서 시작될 수 있으므로, Google SDK 세션 정리를 현재 provider와 무관한 로그아웃 경로로 옮겨야 합니다.
Useful? React with 👍 / 👎.
| let rootViewController = UIApplication.shared.connectedScenes | ||
| .compactMap { $0 as? UIWindowScene } | ||
| .flatMap(\.windows) | ||
| .first(where: \.isKeyWindow)? |
There was a problem hiding this comment.
요청을 시작한 window scene에서 인증 UI를 표시하세요
connectedScenes는 순서가 없는 집합인데 이 코드는 scene의 활성 상태나 요청 출처를 확인하지 않고 첫 isKeyWindow를 선택합니다. 앱이 기본 화면과 Todo editor를 별도 WindowGroup으로 제공하므로 다른 scene이 연결되어 있거나 background에 남아 있으면, main scene에서 시작한 Google 로그인·계정 연결이 editor 또는 background scene의 controller를 선택해 다른 창에 표시되거나 유효하지 않은 presentation context로 실패할 수 있습니다. 전역 첫 window 대신 요청을 시작한 view의 UIWindowScene에 속한 controller를 전달해야 합니다.
Useful? React with 👍 / 👎.
🔗 연관된 이슈
🎯 의도
serverAuthCode만 전달하는 인증 구조로 전환📝 작업 내용
📌 요약
GoogleSignIn패키지와 앱 URL 콜백 처리 추가serverAuthCode기반 API로 전환🔍 상세
GoogleSignIn 연동
GoogleSignIn패키지 의존성과 Infra 모듈 연결 추가AppDelegate.application(_:open:options:)에서 GoogleSignIn URL 콜백 처리TopViewControllerProvider를 통한 GoogleSignIn 표시 화면 탐색GIDSignIn.sharedInstance.signOut()호출 추가로그인 및 계정 연결
serverAuthCode를POST /auth/google/authorization-code/custom-token으로 전달serverAuthCode를PUT /auth/google/authorization-code/account-link로 전달기존 인증 흐름 정리
OAuthAuthenticationTicketRequester를 사용하던 Google 전용 ticket/session 호출 제거환경 설정 및 배포 검증
Info.plist에GIDClientID,GIDServerClientID, reversed client ID URL scheme 연결CLIENT_ID,GID_SERVER_CLIENT_ID,REVERSED_CLIENT_ID확인 추가GIDClientID와 bundledGoogleService-Info.plist의CLIENT_ID일치 여부 확인📸 영상 / 이미지 (Optional)