Skip to content

fix(web): 마이페이지 비로그인 뒤로가기 노출 방지#590

Merged
yoonc01 merged 2 commits into
mainfrom
fix/my-auth-back-navigation
Jun 27, 2026
Merged

fix(web): 마이페이지 비로그인 뒤로가기 노출 방지#590
yoonc01 merged 2 commits into
mainfrom
fix/my-auth-back-navigation

Conversation

@yoonc01

@yoonc01 yoonc01 commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

작업 내용

  • 비로그인 상태에서 마이페이지(/my) 진입 시 프로필 화면이 먼저 렌더링되지 않도록 인증 상태 가드를 추가했습니다.
  • 인증 초기화가 완료되고 로그인 상태가 확인된 경우에만 마이페이지 프로필 API를 호출하도록 useGetMyInfoenabled 옵션을 추가했습니다.
  • 인증 실패 또는 토큰 재발급 실패 시 마이페이지 프로필 캐시를 제거하도록 처리했습니다.
  • 로그인 페이지 이동 시 브라우저 히스토리에 보호 페이지가 남지 않도록 window.location.replace("/login")를 사용하도록 변경했습니다.

특이 사항

  • 기존에는 /my 진입 후 프로필 API 요청 실패 시 axios 인터셉터에서 로그인 페이지로 이동하는 구조라, 뒤로가기 시 마이페이지가 다시 노출될 수 있었습니다.
  • 이번 변경으로 비로그인 상태에서는 마이페이지 콘텐츠 렌더링과 프로필 API 호출을 모두 막습니다.

@yoonc01 yoonc01 self-assigned this Jun 27, 2026
@vercel

vercel Bot commented Jun 27, 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, Comment Jun 27, 2026 2:49pm
solid-connection-web Ready Ready Preview, Comment Jun 27, 2026 2:49pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
solid-connect-web-admin Skipped Skipped Jun 27, 2026 2:49pm

@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@yoonc01, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 49 minutes and 23 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a975d992-fdb8-4581-af18-9f109f2226ef

📥 Commits

Reviewing files that changed from the base of the PR and between ef453f5 and 73e0f8b.

📒 Files selected for processing (1)
  • apps/web/src/app/my/_ui/MyProfileContent/index.tsx

Walkthrough

  1. useGetMyInfo 훅 파라미터 확장

    • enabled?: boolean 옵션을 받는 선택적 파라미터 타입이 추가되었습니다.
    • useQueryenabled 옵션으로 해당 값이 전달됩니다.
  2. MyProfileContent 인증 기반 조회 제어

    • useRouter를 추가해 isInitialized && !isAuthenticated일 때 /login으로 리다이렉트합니다.
    • useGetMyInfo 호출에 enabled: shouldFetchProfile을 적용해 인증된 경우에만 프로필을 요청합니다.
    • 로딩/미인증 상태에서 CloudSpinnerPage를 반환하는 분기 조건이 갱신됩니다.
  3. axiosInstance 인증 해제 시 쿼리 캐시 정리

    • QueryKeys, queryClient를 import하고 clearAuthState 헬퍼가 추가됩니다.
    • 로그인 리다이렉트 시 QueryKeys.MyPage.profile 쿼리 캐시도 함께 제거합니다.
    • window.location.href에서 window.location.replace로 리다이렉트 방식이 변경됩니다.
    • 토큰 재발급 실패 catch 블록에서 clearAccessToken() 대신 clearAuthState()를 호출합니다.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • wibaek
🚥 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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/my-auth-back-navigation

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: ef453f5b7a

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

Comment thread apps/web/src/app/my/_ui/MyProfileContent/index.tsx

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/web/src/app/my/_ui/MyProfileContent/index.tsx`:
- Around line 44-45: MyProfileContent is treating missing profile data as a
loading state, which can leave the UI stuck on CloudSpinnerPage when the profile
request fails. Update the conditional logic in MyProfileContent to separate
loading from failure by checking the query’s isError/error state before the
fallback spinner, and render an error/retry UI for failed fetches instead of
relying on !profileData.
🪄 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c16f9a4c-0e4a-4e41-88c2-9b7567531a8f

📥 Commits

Reviewing files that changed from the base of the PR and between 5da0d6d and ef453f5.

📒 Files selected for processing (3)
  • apps/web/src/apis/MyPage/getProfile.ts
  • apps/web/src/app/my/_ui/MyProfileContent/index.tsx
  • apps/web/src/utils/axiosInstance.ts

Comment thread apps/web/src/app/my/_ui/MyProfileContent/index.tsx
@vercel vercel Bot temporarily deployed to Preview – solid-connect-web-admin June 27, 2026 14:46 Inactive
@yoonc01 yoonc01 merged commit b345b4a into main Jun 27, 2026
13 checks passed
@yoonc01 yoonc01 deleted the fix/my-auth-back-navigation branch June 27, 2026 15:15
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