Skip to content

🐛 어드민 인증 토큰 흐름 분리 - #613

Merged
manNomi merged 4 commits into
mainfrom
fix/admin-auth-token-separation
Aug 1, 2026
Merged

🐛 어드민 인증 토큰 흐름 분리#613
manNomi merged 4 commits into
mainfrom
fix/admin-auth-token-separation

Conversation

@manNomi

@manNomi manNomi commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

관련 이슈

작업 내용

  • 어드민 로그인·재발급·로그아웃 API를 /admin/auth/* 전용 경로로 변경했습니다.
  • access token은 기존 accessToken 응답과 로컬 세션 방식을 유지하고, refresh token은 withCredentials를 통한 어드민 전용 HttpOnly 쿠키로 처리합니다.
  • 로그인 응답 타입에서 더 이상 내려오지 않는 refreshToken을 제거하고 인증 계약 테스트를 추가했습니다.
  • 어드민 access token의 localStorage 저장 키를 accessTokenadminAccessToken으로 변경했습니다. 서버가 어드민 refresh token 쿠키/Redis 키를 adminProdRefreshToken / ADMIN_REFRESH로 분리한 것과 네이밍을 맞추기 위함이며, 별도 마이그레이션 shim은 두지 않았습니다(어드민 사용자가 소수라 재로그인 비용을 허용).
    • 참고로 localStorage는 origin 단위로 격리되어 있어 admin.solid-connection.comsolid-connection.com 간에 실제로 값이 공유되는 위험은 없었습니다. 이번 변경은 유출 위험 제거가 아니라 서버 네이밍과의 일관성 확보 및 accessToken 리터럴 혼동 제거가 목적입니다.
  • 사용되지 않던 deprecated apps/web/src/utils/localStorageUtils.ts를 삭제했습니다(저장소 전체에서 import하는 곳이 없음을 확인).

특이 사항

  • 서버의 어드민 refresh token 분리 배포가 선행되어야 합니다.
  • 일반 웹 인증 API와 세션 흐름은 변경하지 않았습니다.
  • 이 PR 배포 이후, 기존에 로그인돼 있던 어드민 사용자는 localStorage 키 변경으로 인해 세션이 끊기며 한 번 재로그인이 필요합니다.

리뷰 요구사항 (선택)

  • 어드민 인증 경로와 서버 계약이 일치하는지
  • refresh token이 응답 본문이나 로컬 저장소로 노출되지 않는지

검증

  • pnpm --filter @solid-connect/admin test (24 tests)
  • pnpm --filter @solid-connect/admin ci:check
  • VITE_API_SERVER_URL=https://api.example.com VITE_S3_BASE_URL=https://s3.example.com pnpm --filter @solid-connect/admin build
  • (추가) pnpm --filter @solid-connect/admin test (28 tests, adminAccessToken 키 검증 테스트 포함)
  • (추가) pnpm --filter @solid-connect/admin ci:check
  • (추가) pnpm --filter @solid-connect/web run typecheck
  • (추가) pnpm --filter @solid-connect/web run lint

@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
solid-connect-university-web Ready Ready Preview Aug 1, 2026 12:46pm
solid-connect-web-admin Ready Ready Preview Aug 1, 2026 12:46pm
solid-connection-web Ready Ready Preview Aug 1, 2026 12:46pm

@github-actions github-actions Bot added the admin label Jul 31, 2026
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3bd1c124-9fbb-4069-a95c-6d4bc52d11b0

📥 Commits

Reviewing files that changed from the base of the PR and between d682ad0 and 830e737.

📒 Files selected for processing (6)
  • apps/admin/src/lib/api/auth.test.ts
  • apps/admin/src/lib/api/auth.ts
  • apps/admin/src/lib/utils/localStorage.test.ts
  • apps/admin/src/lib/utils/localStorage.ts
  • apps/admin/src/types/auth.ts
  • apps/web/src/utils/localStorageUtils.ts
💤 Files with no reviewable changes (2)
  • apps/admin/src/types/auth.ts
  • apps/web/src/utils/localStorageUtils.ts

Walkthrough

  1. 관리자 인증 API
    로그인, 재발급, 로그아웃 경로를 /admin/auth로 변경하고 withCredentials 설정과 인증 헤더 테스트를 갱신했습니다.

  2. 관리자 토큰 저장소
    access token 저장 키를 adminAccessToken으로 변경하고 저장·조회·삭제 테스트를 추가했습니다.

  3. 인증 타입 및 웹 유틸리티
    refreshToken 필드를 제거하고 웹 앱의 기존 localStorage 유틸리티를 삭제했습니다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: wibaek, enunsnv, whqtker

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 제목은 어드민 인증 토큰 흐름을 분리하는 주요 변경 사항을 간결하게 설명합니다.
Description check ✅ Passed 필수 섹션과 주요 변경 사항, 배포 조건, 영향, 검증 결과를 대부분 충실하게 작성했습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/admin-auth-token-separation

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 68456d277c

ℹ️ 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".

@@ -1,37 +0,0 @@
/**

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Split the unrelated web cleanup into an atomic commit

When this authentication change must be reverted or cherry-picked, deleting the deprecated web utility is forced to travel with the admin endpoint and storage-key changes even though the repository-wide search shows it is unrelated cleanup. Move this deletion to its own commit so each commit contains one logical change as required by the repository convention.

AGENTS.md reference: AGENTS.md:L86-L86

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant