-
Notifications
You must be signed in to change notification settings - Fork 0
feat(mobile): 인증 시스템 개선 - Stack.Protected 및 메모리 캐싱 #51
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
Summary of ChangesHello @dydals3440, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 모바일 앱의 인증 시스템을 전면적으로 개선하는 Pull Request입니다. 기존의 수동적인 라우트 보호 방식을 Expo Router의 Stack.Protected로 전환하여 보안과 관리 효율성을 높였습니다. 또한, Context API를 활용한 새로운 인증 상태 관리 시스템을 도입하고, TokenStore에 메모리 캐싱을 적용하여 성능을 최적화했습니다. 이와 함께 코드 가독성을 높이고 중복 로직을 제거하는 등 전반적인 코드 품질 향상도 이루어졌습니다. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
- Context API 기반 AuthStateProvider 추가 (기존 DI 패턴 유지) - TokenStore 메모리 캐싱으로 성능 개선 - Stack.Protected로 선언적 라우트 보호 (Expo Router SDK 53+) - 중복 로직 제거 (app/index.tsx 삭제) - 인증 훅에 AuthState 통합 (use-exchange-code, use-logout) - 전체 코드베이스 주석 정리 (15+ 파일) - 테스트 환경에 AuthStateProvider 추가 관련 이슈: #50
97f860e to
41dd74d
Compare
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.
Code Review
PR은 모바일 앱의 인증 시스템을 Expo Router의 Stack.Protected와 Context API 기반 상태 관리로 전환하고, TokenStore에 메모리 캐싱을 도입하여 전반적인 아키텍처를 개선했습니다. 기존의 수동적인 인증 라우트 보호 로직을 제거하고 선언적인 방식으로 변경하여 코드의 가독성과 유지보수성을 크게 향상시켰습니다. 또한, 불필요한 JSDoc 및 주석을 제거하고 app/index.tsx 파일을 삭제하여 코드베이스를 깔끔하게 정리한 점도 좋습니다. 전반적으로 잘 계획되고 실행된 변경사항입니다.
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.
Pull request overview
This pull request improves the mobile app's authentication system by replacing manual route protection with Expo Router's declarative Stack.Protected, introducing Context API-based auth state management, and adding memory caching to TokenStore for performance optimization.
Changes:
- Replaced manual useEffect-based route protection with Expo Router's Stack.Protected for declarative, secure route guarding
- Added AuthStateProvider for centralized authentication state management using Context API
- Implemented memory caching in TokenStore to reduce SecureStore I/O operations while maintaining security
- Removed extensive JSDoc comments across 15+ files to improve code readability
- Deleted redundant app/index.tsx as Stack.Protected now handles route protection automatically
Reviewed changes
Copilot reviewed 19 out of 21 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-workspace.yaml | Updated TypeScript catalog version from ^5.9.0 to ^5.9.3 |
| pnpm-lock.yaml | Updated dependency lock file with new package versions |
| package.json | Updated devDependencies: @biomejs/biome and turbo to latest versions |
| apps/mobile/package.json | Added ts-pattern dependency and updated @tanstack/react-query |
| apps/api/package.json | Updated NestJS packages, pino, and resend to latest versions |
| apps/mobile/uniwind-types.d.ts | Reformatted type definitions (removed semicolons) |
| apps/mobile/src/shared/storage/token-store.ts | Added memory caching layer with initialize() method for performance optimization |
| apps/mobile/src/core/providers/auth-state-provider.tsx | New provider for managing global authentication state with TokenStore integration |
| apps/mobile/src/features/auth/presentation/hooks/use-logout.ts | Integrated clearAuth() call from AuthStateProvider |
| apps/mobile/src/features/auth/presentation/hooks/use-exchange-code.ts | Integrated setAuthenticated() call from AuthStateProvider |
| apps/mobile/src/features/auth/presentation/hooks/use-get-me.ts | Removed JSDoc comments |
| apps/mobile/src/features/auth/presentation/hooks/use-open-kakao-login.ts | Removed JSDoc comments |
| apps/mobile/src/features/auth/presentation/providers/auth.provider.tsx | Removed JSDoc comments |
| apps/mobile/src/features/auth/presentation/constants/auth-query-keys.constant.ts | Removed JSDoc comments |
| apps/mobile/src/features/auth/domain/repositories/auth.repository.ts | Removed JSDoc comments |
| apps/mobile/src/features/auth/domain/models/user.model.ts | Removed JSDoc comments and property descriptions |
| apps/mobile/src/features/auth/data/repositories/auth.repository.impl.ts | Removed JSDoc comments |
| apps/mobile/src/features/auth/application/services/auth.service.ts | Removed JSDoc comments, simplified error comment |
| apps/mobile/src/core/providers/query-provider.tsx | Removed inline comment explaining 401 retry logic |
| apps/mobile/src/core/di/container.ts | Removed JSDoc comments |
| apps/mobile/src/core/di/app-providers.tsx | Removed JSDoc comments, added AuthStateProvider to provider hierarchy |
| apps/mobile/src/shared/testing/test-render.tsx | Added AuthStateProvider to test setup, removed comments |
| apps/mobile/app/_layout.tsx | Replaced manual route protection logic with Stack.Protected implementation |
| apps/mobile/app/index.tsx | Deleted file - Stack.Protected handles initial routing |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@hijjoy |
|
@hijjoy 이 방식은 Expo 공식 레이아웃 시스템을 활용하여 주요 구현 포인트와 구조를 정리하면 다음과 같습니다. 🏗️ 구현 핵심 요약
해당 영상에서 제시하는 Expo Router의 파일 기반 라우팅 특성을 살려 깔끔하게 구조화해 보았으니 혹시나 더 좋은 방법이 있으면 커멘트 남겨주시면 반영해볼게요~! |
개요
모바일 앱의 인증 시스템을 전면 개선했습니다. 기존의 수동 라우트 보호 방식을 Expo Router의 Stack.Protected로 전환하고, Context API 기반의 인증 상태 관리를 추가했으며, TokenStore에 메모리 캐싱을 도입하여 성능을 개선했습니다.
변경 유형
영향 범위
apps/mobile)변경 내용
1. Stack.Protected 도입
2. Context API 기반 인증 상태 관리
3. TokenStore 메모리 캐싱
4. 코드 정리
5. 중복 로직 제거
테스트
pnpm test)pnpm typecheck)pnpm lint)체크리스트
pnpm test)pnpm typecheck)pnpm lint)관련 이슈
Closes #50
추가 정보