📝 현재 문제점
- 현재 프로젝트에 인증 인프라가 구축되어 있지 않음
- API 호출 시 JWT 토큰을 수동으로 헤더에 주입해야 함
- 토큰 만료(401) 시 자동 재발급 로직이 없어 사용자가 강제로 재로그인해야 함
- Firebase 기반 소셜 로그인(Google/Apple) 인프라 부재
🛠️ 해결 방안 / 제안 기능
docs/AUTH_INFRA_PORTING_GUIDE.md 문서를 기반으로 검증된 Auth 인프라를 본 프로젝트에 이식
핵심 기능:
- Firebase 기반 Google/Apple 소셜 로그인
- 로그인 성공 시 백엔드로부터 JWT(access + refresh) 토큰 발급 및 안전 저장
- 모든 API 요청에 Authorization 헤더 자동 주입
- 401 발생 시 refresh token 으로 자동 재발급(reissue) 후 원 요청 재시도
- 재발급 실패 시 강제 로그아웃 처리 (Firebase signOut + 토큰 삭제 + 로그인 화면 이동)
- 동시 다발 401 발생 시 단 한 번의 reissue 만 수행하도록 요청 큐잉 (
QueuedInterceptor)
- 재시도 무한 루프 방지 가드
⚙️ 작업 내용
pubspec.yaml 의존성 추가 및 버전 동기화 (특히 retrofit: 4.7.3 핀)
- Core 레이어 이식
core/errors/app_exception.dart
core/network/api_error_response.dart
core/network/dio_exception_handler.dart
core/network/auth_interceptor.dart (_publicPaths 프로젝트별 조정)
core/network/dio_client.dart
core/storage/secure_token_storage.dart
core/config/env_config.dart (환경 변수 키 본 프로젝트 기준 조정)
core/constants/api_endpoints.dart (본 프로젝트 API 스펙 기준 작성)
- Auth Feature 이식
- Domain:
auth_result_entity, auth_repository, firebase_auth_error_handler
- Data:
firebase_auth_datasource, auth_remote_datasource, DTO 모델, auth_repository_impl
- Presentation:
auth_provider (Cold-start 토큰 복원 로직 본 프로젝트 기준 조정)
- Firebase 프로젝트 연동 설정 (
google-services.json / GoogleService-Info.plist)
- 환경 변수(.env) 셋업
- 동작 검증 시나리오: 소셜 로그인 → JWT 발급 → API 자동 인증 → 401 자동 reissue → reissue 실패 시 강제 로그아웃
📋 참고 자료
docs/AUTH_INFRA_PORTING_GUIDE.md
- 원본 repo:
cops_and_robbers (Flutter 3.9.2+, Dart 3.9.2+)
🙋♂️ 담당자
- 백엔드: 이름
- 프론트엔드: 이름
- 디자인: 이름
📝 현재 문제점
🛠️ 해결 방안 / 제안 기능
docs/AUTH_INFRA_PORTING_GUIDE.md문서를 기반으로 검증된 Auth 인프라를 본 프로젝트에 이식핵심 기능:
QueuedInterceptor)⚙️ 작업 내용
pubspec.yaml의존성 추가 및 버전 동기화 (특히retrofit: 4.7.3핀)core/errors/app_exception.dartcore/network/api_error_response.dartcore/network/dio_exception_handler.dartcore/network/auth_interceptor.dart(_publicPaths프로젝트별 조정)core/network/dio_client.dartcore/storage/secure_token_storage.dartcore/config/env_config.dart(환경 변수 키 본 프로젝트 기준 조정)core/constants/api_endpoints.dart(본 프로젝트 API 스펙 기준 작성)auth_result_entity,auth_repository,firebase_auth_error_handlerfirebase_auth_datasource,auth_remote_datasource, DTO 모델,auth_repository_implauth_provider(Cold-start 토큰 복원 로직 본 프로젝트 기준 조정)google-services.json/GoogleService-Info.plist)📋 참고 자료
docs/AUTH_INFRA_PORTING_GUIDE.mdcops_and_robbers(Flutter 3.9.2+, Dart 3.9.2+)🙋♂️ 담당자