Skip to content

feat(ADMIN-271): 로그아웃 기능 추가 및 SideBar 추가 - #3

Merged
seyun31 merged 2 commits into
mainfrom
feat/admin-271-logout
Sep 9, 2025
Merged

feat(ADMIN-271): 로그아웃 기능 추가 및 SideBar 추가#3
seyun31 merged 2 commits into
mainfrom
feat/admin-271-logout

Conversation

@seyun31

@seyun31 seyun31 commented Sep 9, 2025

Copy link
Copy Markdown
Contributor
  • feat: SideBar 추가 및 로그아웃 기능 추가
  • fix: 로그인 상태에서 관리자 확인 알림 삭제

Summary by CodeRabbit

  • New Features

    • 로그아웃 기능 추가: 사용자 확인 후 쿠키와 스토리지 정리, 성공/실패 알림 및 로그인 페이지로 이동.
    • 사이드바 내비게이션 추가: 홈/행사/쿠폰/포인트로 빠른 이동, 활성 상태 표시.
  • Style

    • 상단 헤더를 고정 바로 개선하고 클릭/호버 상호작용 강화.
    • 홈·행사 페이지를 사이드바 기반 2열 레이아웃으로 재구성해 정렬과 여백 최적화.
  • Refactor

    • 관리자 환영 알림을 최초 1회만 표시하도록 세션 저장소로 제어.

@seyun31 seyun31 self-assigned this Sep 9, 2025
@coderabbitai

coderabbitai Bot commented Sep 9, 2025

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Walkthrough

인증 로그아웃 모듈을 신설해 쿠키/스토리지 정리를 구현하고, Header에서 확인 후 로그아웃 호출과 리다이렉트를 추가했습니다. Sidebar 컴포넌트를 도입해 홈/행사/쿠폰/포인트 내비게이션을 제공하고, home/event 페이지 레이아웃을 사이드바 기반 2열 구조로 조정했습니다. ADMIN 환영 알림은 세션 스토리지 플래그로 1회만 노출됩니다.

Changes

Cohort / File(s) Change Summary
Auth: Logout 모듈 추가
src/api/auth/logout.ts
쿠키 단건/일괄 삭제 유틸 추가, sessionStorage 초기화 및 특정 localStorage 키 제거, logout() 비동기 API와 logoutWithSpecificCookie() 동기 API 신설. 콘솔 로그(ko).
Auth: Members 알림 가드
src/api/auth/members.ts
ADMIN 경로에서 sessionStorage.hasShownWelcome 체크로 환영 알림 1회만 표시. 외부 인터페이스 변화 없음.
UI: Header 로그아웃 연동/레이아웃 조정
src/components/Header.tsx
logout API 연동, 확인 다이얼로그 후 logout() 호출·성공 시 알림 및 /login 리다이렉트, 실패 시 에러 알림. 상단 고정 바 및 클릭 이동/호버 스타일 조정.
UI: Sidebar 신규
src/components/SideBar.tsx
고정 세로 내비 컴포넌트 추가. NavLink 4개(홈, 행사, 쿠폰, 포인트), 활성/비활성 스타일, 아이콘/라벨 렌더링. 기본 export.
Pages: 레이아웃을 Sidebar 기반으로 변경
src/page/event.tsx, src/page/home.tsx
Sidebar 포함 2열 레이아웃 적용 및 패딩/여백 조정. Event: 콘텐츠 영역 중앙 정렬 래퍼 추가. Home: Header 위치 조정 및 Sidebar 포함 컨테이너 구성.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User as 사용자
  participant Header as Header 컴포넌트
  participant Auth as logout API
  participant Browser as 브라우저(쿠키/스토리지)
  participant Router as 라우터

  User->>Header: 로그아웃 버튼 클릭
  Header->>User: 확인 다이얼로그 표시
  alt 사용자 확인
    Header->>Auth: logout()
    Auth->>Browser: 모든 쿠키 삭제 시도
    Auth->>Browser: sessionStorage clear
    Auth->>Browser: localStorage 'currentActivityId' 제거
    Auth-->>Header: true/false
    alt 성공
      Header->>User: 성공 알림
      Header->>Router: /login로 이동
    else 실패
      Header->>User: 오류 알림
    end
  else 취소
    Header-->>User: 취소(변경 없음)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between c13631f and de70cec.

📒 Files selected for processing (6)
  • src/api/auth/logout.ts (1 hunks)
  • src/api/auth/members.ts (1 hunks)
  • src/components/Header.tsx (2 hunks)
  • src/components/SideBar.tsx (1 hunks)
  • src/page/event.tsx (2 hunks)
  • src/page/home.tsx (2 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/admin-271-logout

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.

@seyun31
seyun31 merged commit c9f3c8e into main Sep 9, 2025
1 of 2 checks passed
@seyun31
seyun31 deleted the feat/admin-271-logout branch September 9, 2025 12:52
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.

1 participant