Skip to content

Conversation

@yeonjin719
Copy link
Member

🚨 관련 이슈

✨ 변경사항

  • 🐞 BugFix Something isn't working
  • 💻 CrossBrowsing Browser compatibility
  • 🌏 Deploy Deploy
  • 🎨 Design Markup & styling
  • 📃 Docs Documentation writing and editing (README.md, etc.)
  • ✨ Feature Feature
  • 🔨 Refactor Code refactoring
  • ⚙️ Setting Development environment setup
  • ✅ Test Test related (storybook, jest, etc.)

✏️ 작업 내용

  • 작업 내용

😅 미완성 작업

  • Task1

📢 논의 사항 및 참고 사항

@coderabbitai
Copy link

coderabbitai bot commented Aug 15, 2025

Summary by CodeRabbit

  • 신규 기능
    • 푸터의 ‘개인정보 처리방침’, ‘고객문의’ 클릭 시 안내 알림(“아직 지원하지 않는 기능이에요”)을 표시합니다. ‘공지사항’, ‘자주 묻는 질문’은 기존과 동일합니다.
  • 버그 수정
    • 세션 만료/권한 오류 처리 안정화: 401 응답 시 토큰 갱신 후 재시도, 실패 시 자동 로그아웃과 저장 정보 정리, 로그인 페이지로 이동합니다.
    • 사용자 정보 없음(404) 상황에 대한 한국어 안내 문구로 처리 일관성 개선.

Walkthrough

응답 인터셉터에서 문자열 메시지 기반 판별을 HTTP 상태 코드 기반(401/404)으로 변경하고, 토큰 갱신 실패 분기 메시지를 조정했습니다. 푸터의 일부 링크를 알림을 띄우는 정적 요소로 전환했습니다. 공개 API 시그니처 변화는 없습니다.

Changes

Cohort / File(s) Change Summary
Auth interceptor status-based handling
src/api/axiosInstance.ts
에러 판별 로직을 response 데이터 문자열 비교에서 status 코드(401, 404) 기반으로 변경. 401 시 리프레시 시도 및 성공 시 재시도 유지. 401/404 실패 시 로그아웃 및 스토리지 초기화. 메시지 일부 변경. 기타 동작(리다이렉트 가드, 로그인/회원가입 경로 예외) 유지.
Footer link behavior
src/components/layout/Footer.tsx
루트로 이동하던 두 링크(‘개인정보 처리방침’, ‘고객문의’)를 네비게이션 없이 알림(‘아직 지원하지 않는 기능이에요’)을 띄우는 클릭 가능한 div로 변경. 나머지 링크는 그대로.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant App
  participant Axios as Axios Interceptor
  participant API
  participant Auth as Token Refresh API

  User->>App: 요청 트리거
  App->>Axios: HTTP 요청
  Axios->>API: 원본 요청 전송
  API-->>Axios: 응답(200/401/기타)
  alt 200
    Axios-->>App: 정상 응답 전달
  else 401 (로그인/회원가입 제외, 미리다이렉트)
    Axios->>Auth: 토큰 리프레시 요청
    alt 리프레시 성공
      Axios->>API: 원본 요청 재시도
      API-->>Axios: 재시도 응답
      Axios-->>App: 재시도 결과 전달
    else 리프레시 실패(401/404)
      Axios-->>App: 로그아웃 및 스토리지 초기화, 오류 처리
    end
  else 기타 오류
    Axios-->>App: 로그/로그아웃/스토리지 초기화
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 5bd0ffe and 1ab1188.

📒 Files selected for processing (2)
  • src/api/axiosInstance.ts (2 hunks)
  • src/components/layout/Footer.tsx (2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
src/components/layout/Footer.tsx (2)
src/layout/layout.tsx (1)
  • Layout (10-20)
src/components/home/info.tsx (1)
  • MainInfo (10-68)
src/api/axiosInstance.ts (1)
src/api/auth/auth.ts (1)
  • logout (33-36)
🪛 Biome (2.1.2)
src/components/layout/Footer.tsx

[error] 10-11: Static Elements should not be interactive.

To add interactivity such as a mouse or key event listener to a static element, give the element an appropriate role value.

(lint/a11y/noStaticElementInteractions)


[error] 10-11: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.

Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.

(lint/a11y/useKeyWithClickEvents)

🔇 Additional comments (1)
src/api/axiosInstance.ts (1)

43-49: refreshError.statusrefreshError.response?.status로 수정 필요

아래처럼 분기 조건을 고쳐야 정상적으로 동작합니다:

@@ src/api/axiosInstance.ts:43-49
-                    if (refreshError.status === 401) {
+                    if (refreshError.response?.status === 401) {
                         console.error('refreshToken이 없습니다. 로그인 페이지로 이동합니다.');
                         void logout();
                         localStorage.clear();
-                    } else if (refreshError.status === 404) {
+                    } else if (refreshError.response?.status === 404) {
                         console.error('사용자 정보를 찾지 못했습니다. 로그인 페이지로 이동합니다.');
                         void logout();
                         localStorage.clear();

수동 점검 부탁드립니다:

  • 백엔드가 실제로 401/404 상태코드를 위 케이스에 매핑하는지 확인
  • 과거 메시지 기반 분기 흔적(예: "The token is null.", "The token is invalid.")이 남아 있는지 아래 명령어로 추가 점검
    rg -nP -C2 "The token is (null|invalid)\."

(response) => response,
async (error) => {
if (error.response?.data.error === 'Unauthorized') {
if (error.status === 401) {
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

AxiosError에 status 필드 직접 접근은 잘못된 패턴 — 401 분기 동작하지 않습니다

Axios에서는 HTTP 상태코드가 error.response?.status에 있습니다. 현재 error.status === 401은 항상 실패하여 리프레시 로직이 실행되지 않습니다.

아래처럼 수정해 주세요.

-        if (error.status === 401) {
+        if (error.response?.status === 401) {

다음 스크립트로 레포 내에서 유사한 오용을 점검해 주세요.


🏁 Script executed:

#!/bin/bash
# AxiosError에서 .status 직접 접근 사용 여부 점검
rg -nP -C2 --type=ts --type=tsx '\b(?:error|refreshError)\.status\b'

Length of output: 98


이전 스크립트에서 --type=tsx를 인식하지 못해 오류가 발생했습니다. 아래처럼 파일 확장자를 직접 지정해 다시 확인해 주세요.


🏁 Script executed:

#!/bin/bash
# AxiosError에서 .status 직접 접근 사용 여부 점검 (.ts, .tsx 파일 대상)
rg -nP -C2 '\b(?:error|refreshError)\.status\b' -g '*.ts' -g '*.tsx'

Length of output: 1157


AxiosError 상태코드 접근 방식 수정 요청

AxiosError의 HTTP 상태코드는 error.response?.status에 저장되므로, error.status 또는 refreshError.status 직접 접근은 항상 undefined를 반환해 분기가 동작하지 않습니다. 아래 3곳을 모두 수정해 주세요.

• src/api/axiosInstance.ts:21

-        if (error.status === 401) {
+        if (error.response?.status === 401) {

• src/api/axiosInstance.ts:43

-                    if (refreshError.status === 401) {
+                    if (refreshError.response?.status === 401) {

• src/api/axiosInstance.ts:47

-                    } else if (refreshError.status === 404) {
+                    } else if (refreshError.response?.status === 404) {
🤖 Prompt for AI Agents
In src/api/axiosInstance.ts around lines 21, 43 and 47, the code is checking
error.status / refreshError.status but AxiosError stores HTTP status on
error.response?.status; update all three checks to read error.response?.status
(and refreshError.response?.status) instead of error.status, using optional
chaining and proper type narrowing/casting for AxiosError if needed so the 401
and other status branches evaluate correctly.

Comment on lines +10 to 11
<div onClick={() => alert('아직 지원하지 않는 기능이에요')}>개인정보 처리방침</div>
</li>
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

div에 onClick 사용으로 접근성(a11y) 위반 — button으로 교체 권장

정적 요소에 인터랙션을 부여해 lint 경고가 발생합니다(noStaticElementInteractions, useKeyWithClickEvents). 시멘틱한 <button>을 사용하면 키보드 접근성(Enter/Space)과 역할 노출이 자동으로 해결됩니다.

아래처럼 교체해 주세요.

-                        <div onClick={() => alert('아직 지원하지 않는 기능이에요')}>개인정보 처리방침</div>
+                        <button type="button" onClick={() => alert('아직 지원하지 않는 기능이에요')} className="cursor-pointer">
+                            개인정보 처리방침
+                        </button>
...
-                        <div onClick={() => alert('아직 지원하지 않는 기능이에요')}>고객문의</div>
+                        <button type="button" onClick={() => alert('아직 지원하지 않는 기능이에요')} className="cursor-pointer">
+                            고객문의
+                        </button>

참고: 향후 실제 페이지가 준비되면 <Link>로 되돌리거나, 준비 중인 기능이라면 토스트/모달 등 비차단 UI를 고려해 주세요.

Also applies to: 23-24

🧰 Tools
🪛 Biome (2.1.2)

[error] 10-11: Static Elements should not be interactive.

To add interactivity such as a mouse or key event listener to a static element, give the element an appropriate role value.

(lint/a11y/noStaticElementInteractions)


[error] 10-11: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.

Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.

(lint/a11y/useKeyWithClickEvents)

🤖 Prompt for AI Agents
In src/components/layout/Footer.tsx around lines 10-11 (and also apply same
change to lines 23-24), replace the interactive <div> with a semantic <button>
so keyboard and screen-reader accessibility is provided; keep the existing
onClick handler, add type="button" to avoid form submit side-effects, preserve
existing className/styles and aria-label if needed, and remove any redundant
role or tabIndex attributes—when the real page exists switch back to a <Link> or
use a non-blocking toast/modal for “coming soon” behavior.

@yeonjin719 yeonjin719 merged commit 8576692 into main Aug 15, 2025
3 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Aug 16, 2025
10 tasks
@yeonjin719 yeonjin719 changed the title 배포 [Deploy] 배포 Aug 18, 2025
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.

2 participants