Skip to content

fix: 어드민 로그아웃 세션 정리#528

Merged
manNomi merged 1 commit into
mainfrom
fix/admin-logout-server-session
May 25, 2026
Merged

fix: 어드민 로그아웃 세션 정리#528
manNomi merged 1 commit into
mainfrom
fix/admin-logout-server-session

Conversation

@manNomi
Copy link
Copy Markdown
Contributor

@manNomi manNomi commented May 25, 2026

관련 이슈

  • resolves: 없음

작업 내용

  • 어드민 로그아웃 버튼에서 서버 /auth/sign-out API를 호출하도록 연결했습니다.
  • 로그아웃 후 refresh cookie로 /auth/reissue가 다시 성공해 세션이 복구되는 흐름을 막기 위해 로그인 페이지의 로그아웃 직후 자동 세션 확인을 건너뜁니다.
  • 진행 중이던 reissue 응답이 늦게 도착해 access token을 다시 저장하지 않도록 세션 버전 방어 로직을 추가했습니다.

특이 사항

  • 서버 로그아웃 요청이 실패해도 로컬 세션은 정리하고 로그인 화면으로 이동합니다.
  • 로컬 Node 버전이 v23.10.0이라 루트 engines.node: 22.x 경고가 출력되지만 검증은 통과했습니다.

리뷰 요구사항 (선택)

  • 로그아웃 직후 /auth/login?loggedOut=1에서 reissue를 건너뛰는 방식이 운영 플로우에 맞는지 확인 부탁드립니다.

검증

  • pnpm --filter @solid-connect/admin lint:check
  • pnpm --filter @solid-connect/admin typecheck
  • pnpm --filter @solid-connect/admin build
  • commit hook: @solid-connect/admin ci:check
  • push hook: @solid-connect/admin ci:check, @solid-connect/admin build

@vercel
Copy link
Copy Markdown

vercel Bot commented May 25, 2026

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

Project Deployment Actions Updated (UTC)
solid-connect-web-admin Ready Ready Preview, Comment May 25, 2026 1:49pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
solid-connection-web Skipped Skipped May 25, 2026 1:49pm

@github-actions github-actions Bot added the admin label May 25, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 25, 2026

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

Run ID: 17486c69-0979-4e2d-8da8-103a7a9b8651

📥 Commits

Reviewing files that changed from the base of the PR and between 0541110 and a0f6602.

📒 Files selected for processing (4)
  • apps/admin/src/app/auth/login/page.tsx
  • apps/admin/src/components/layout/AdminLayout.tsx
  • apps/admin/src/lib/api/auth.ts
  • apps/admin/src/lib/auth/session.ts

워크스루

이 PR은 관리자 로그아웃 흐름을 안전성과 사용자 경험 측면에서 개선합니다.

1. 세션 재발급 중 로그아웃 시 발생하는 경합 상태 방지
세션 재발급이 진행 중인 상태에서 로그아웃이 호출되면, 이미 무효화된 토큰이 저장될 수 있는 문제를 해결하기 위해 sessionVersion 상태 변수와 버전 검증 로직을 도입합니다.

2. 백엔드 로그아웃 API 엔드포인트 추가
기존 클라이언트 측 정리만으로는 부족하므로, 백엔드 /auth/sign-out 엔드포인트를 호출하는 adminSignOutApi() 함수를 추가하여 서버 세션도 함께 정리합니다.

3. AdminLayout 로그아웃 핸들러를 비동기 흐름으로 변경
로그아웃 버튼 클릭 시 isLoggingOut 상태로 중복 요청을 방지한 뒤, API 호출 결과에 따라 성공/실패 토스트를 구분하여 표시합니다. 최종적으로 세션을 정리하고 로그인 페이지로 리다이렉트합니다.

4. 로그인 페이지에서 loggedOut 쿼리 파라미터 처리
로그아웃 후 로그인 페이지 진입 시 loggedOut=1 파라미터를 감지하여 불필요한 세션 검증을 건너뛰고 즉시 로그인 화면을 렌더링합니다.

예상 코드 리뷰 난이도

🎯 3 (Moderate) | ⏱️ ~20 분

제안 리뷰어

  • wibaek
  • enunsnv
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 제목이 PR의 핵심 변경사항(어드민 로그아웃 세션 정리)을 명확하고 간결하게 요약하고 있습니다.
Description check ✅ Passed PR 설명이 필수 섹션(관련 이슈, 작업 내용, 특이 사항)을 모두 포함하고 있으며 변경사항이 상세히 기술되어 있습니다.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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-logout-server-session

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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 and usage tips.

@manNomi manNomi merged commit 56daea0 into main May 25, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant