Conversation
📝 WalkthroughWalkthrough인증 상태 조회 기능이 추가되었습니다. 새로운 엔드포인트 및 타입, React Query 옵션이 도입되고, 공지사항 페이지에서 인증 상태를 확인해 미인증 사용자를 인증 필요 경로로 리다이렉트합니다. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/audience/src/entities/auth/api/auth.ts`:
- Line 3: The import of AuthStatusResponse is a type-only import and should use
`import type` to avoid adding runtime dependency; update the import statement
that references AuthStatusResponse in
apps/audience/src/entities/auth/api/auth.ts to use a type-only import (i.e.,
`import type { AuthStatusResponse } ...`) so the type is erased at runtime and
no unnecessary bundle dependency is introduced.
In `@apps/audience/src/entities/auth/types/response.ts`:
- Around line 1-5: Narrow the AuthStatusResponse.userType from string to a union
of literal types that match backend values (e.g., 'ORGANIZER' | 'AUDIENCE') by
updating the AuthStatusResponse interface; also review the response contract for
authenticated === false and adjust types for email and userType (make them
optional or nullable) if the backend omits or returns empty values so
AuthStatusResponse, userType, authenticated, and email accurately reflect the
API shape.
In `@apps/audience/src/pages/notice-list/notice-list.tsx`:
- Around line 46-47: The auth status query currently uses
useQuery(AUTH_QUERY_OPTIONS.AUTH_STATUS()) which may cause unwanted automatic
retries on 401/authorization failures; update the call to merge in retry: false
(e.g., call useQuery({...AUTH_QUERY_OPTIONS.AUTH_STATUS(), retry: false})) and
also destructure the error flag (e.g., isError as isAuthError) so the component
can handle auth failures explicitly; locate the useQuery invocation and
AUTH_QUERY_OPTIONS.AUTH_STATUS() to apply these changes.
- Around line 104-107: The guard checking statusData?.authenticated === false is
dead code because axios interceptors already redirect 401s and statusData is
undefined during redirect or true for authenticated users; remove this
conditional block (the if that calls navigate(ROUTE_PATH.AUTH_REQUIRED)) from
the NoticeList component and rely on the interceptor, or alternatively change
the auth status fetch to return { authenticated: false } with 200 and update the
component to check statusData.authenticated === false before showing
auth-sensitive UI; update any references to statusData, navigate, and
ROUTE_PATH.AUTH_REQUIRED accordingly so no unreachable guard remains.
In `@apps/audience/src/shared/constants/end-point.ts`:
- Line 40: The GET_AUTH_STATUS entry in the end-point constants lacks a trailing
comma; update the constant map to add a trailing comma after GET_AUTH_STATUS:
'/auth/status' so it matches other entries and keeps diffs clean when new
endpoints are added (look for the GET_AUTH_STATUS symbol in end-point.ts and add
the comma).
In `@apps/audience/src/shared/constants/query-key.ts`:
- Line 64: The AUTH_STATUS entry (AUTH_STATUS: () => [...USERS_QUERY_KEY.ALL,
'auth-status']) is missing a trailing comma; update this constant to include a
trailing comma after the closing comma in the array-returning arrow function to
match the file's other entries and maintain consistent formatting for cleaner
future diffs (modify the AUTH_STATUS definition).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 4edeb4e2-bc59-4a29-b706-55580d8d9e7f
📒 Files selected for processing (6)
apps/audience/src/entities/auth/api/auth.tsapps/audience/src/entities/auth/model/query-options.tsapps/audience/src/entities/auth/types/response.tsapps/audience/src/pages/notice-list/notice-list.tsxapps/audience/src/shared/constants/end-point.tsapps/audience/src/shared/constants/query-key.ts
jisooooooooooo
left a comment
There was a problem hiding this comment.
불필요한 모달 노출도 없어지고 더 자연스러워진 것 같네요 👍🏻👍🏻
API 부분도 다음 스프린트 시작 전에 회의하면서 컨벤션 다시 정해봐도 좋을 것 같아요!!
📌 Summary
알림 구독 로직 수정
📚 Tasks
🔍 Describe
배경
현재 알림 구독 플로우는
알림 OS 모달 노출 → 토큰 발급 → 알림 구독 요청 순서로 동작하고 있습니다.
다만 전역 에러 핸들링(401, 403, 404)은 API 요청 이후에만 동작하기 때문에, 비로그인 사용자도 알림 구독 API 요청 전에 알림 OS 모달이 먼저 노출되는 문제가 있었습니다.
이에 알림 OS 모달 노출 전에 로그인 여부를 먼저 확인할 수 있도록 로직을 수정했습니다.
수정 내용
로그인 상태를 확인할 수 있는 API를 사용해, 알림 OS 모달 노출 전에 로그인 여부를 먼저 확인하도록 로직을 수정했습니다.
비로그인 사용자라면 알림 OS 모달을 노출하지 않고 로그인 유도 페이지로 이동하도록 처리했습니다.
👀 To Reviewer
더 나은 개선 방향이 있다면 코멘트 부탁드립니다 👀☺️
api 부분이 뒤죽박죽인 거 같아서,, 1차 스프린트 이후에 컨벤션 확실히 정해서 통일시켜보아요 !!
📸 Screenshot
2026-04-03.11.44.51.mov