Skip to content

feat/인증 상태 관리#21

Merged
AndyH0ng merged 4 commits intodevelopfrom
feat/zustand#20
Jan 2, 2026
Merged

feat/인증 상태 관리#21
AndyH0ng merged 4 commits intodevelopfrom
feat/zustand#20

Conversation

@AndyH0ng
Copy link
Member

@AndyH0ng AndyH0ng commented Jan 2, 2026

📌 관련 이슈

✨ 변경 내용

  • zustand로 인증 관련 상태를 전역으로 관리
  • 로컬 개발 환경을 위한 npm 파라미터 추가 및 문서화

💡 참고 사항

Discord에 공유된 openapi.yml을 레퍼런스로 작업합니다. (26.1.3 기준)

해야할 것

  • 로그인되지 않았을 때 특정 서비스는 ProtectedRoute로 접근을 제한합니다
  • useAuth 커스텀 훅으로 책임을 분리합니다

- authStore 추가
- persist 미들웨어로 localStorage 연동
- User, AuthProvider 타입 분리
@AndyH0ng AndyH0ng self-assigned this Jan 2, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @AndyH0ng, 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!

이 PR은 Zustand를 도입하여 애플리케이션의 전역 인증 상태를 효율적으로 관리하고, 로컬 개발 환경 설정을 개선하며 환경 변수 관리를 위한 포괄적인 문서를 제공합니다. 이를 통해 개발자는 인증 상태를 쉽게 제어하고, 다양한 환경에서 일관된 방식으로 애플리케이션을 개발하고 빌드할 수 있습니다.

Highlights

  • Zustand를 활용한 인증 상태 관리: 새로운 파일 src/stores/authStore.ts가 추가되어 Zustand와 zustand/middlewarepersist를 사용하여 사용자 인증 상태(user, accessToken, isAuthenticated)를 전역으로 관리하고 로컬 스토리지에 저장합니다.
  • 로컬 개발 환경 설정 및 문서화: package.jsondev:localbuild:dev 스크립트가 추가되었고, .env.local.example 파일과 docs/environment.md 문서가 새로 생성되어 로컬 개발 환경 설정 및 환경 변수 관리에 대한 상세한 가이드를 제공합니다.
  • 환경 변수 관리 개선: .env.example 파일에 주석이 추가되고, .gitignore가 업데이트되어 다양한 환경 변수 파일(env.development, env.production, env.local)을 올바르게 처리하며, src/vite-env.d.ts를 통해 환경 변수에 대한 타입 정의가 추가되었습니다.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

이번 PR은 Zustand를 사용하여 인증 상태를 전역으로 관리하고, 로컬 개발 환경 설정을 개선하는 내용을 담고 있습니다. 새로운 authStore를 도입하여 로그인, 로그아웃, 사용자 정보 업데이트 기능을 구현하셨네요. 또한, dev:local 스크립트 추가와 환경 변수 문서화는 다른 개발자들이 프로젝트에 참여하기 용이하게 만들어주는 좋은 변경입니다. 코드 리뷰에서는 authStore의 상태 설계를 개선할 수 있는 점을 제안했습니다. isAuthenticated 상태를 accessToken 유무에 따라 파생되도록 변경하면, 상태의 중복을 제거하고 불일치 가능성을 줄여 코드의 안정성을 높일 수 있을 것입니다. 전반적으로 인증 관리의 기반을 잘 마련했으며, 문서화도 꼼꼼하게 진행해주셔서 좋습니다.

- TO BE: 컴포넌트에서 필요할 때 `const isAuthenticated = useAuthStore(state => !!state.accessToken);` 와 같이 파생해서 사용합니다.
@AndyH0ng AndyH0ng merged commit 079dc4c into develop Jan 2, 2026
1 check passed
@AndyH0ng AndyH0ng deleted the feat/zustand#20 branch January 12, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: 인증 상태 관리

1 participant