Skip to content

Conversation

@Chiman2937
Copy link
Member

@Chiman2937 Chiman2937 commented Dec 31, 2025

📝 변경 사항

💡 Axios Redirect 로직 개선

❓ 상황

  1. 인증 필요한 API(ex. 유저 팔로우) 요청 시 /login으로 redirect 되어야 함
  2. 프로필 페이지 접속 시 내 정보 요청(userGetMe) 할 때 /login으로 redirect 되지 않아야 함

❌ 문제

인증 필요한 API 요청 시 /login redirect가 발생하지 않음

✅ 해결

  1. originalRequest.skipAuthRedirect가 지정되지 않은 경우 undefined로 전달되기 때문에 redirect 로직 전체가 동작 하지 않음
  2. 따라서 originalRequest.skipAuthRedirect가 undefined인 경우 true로 덮어씌움

🔍 결과

  1. 인증 필요한 API(ex. 유저 팔로우) 요청 시 /login으로 redirect 됨
  2. 프로필 페이지 접속 시 내 정보 요청(userGetMe) 할 때 /login으로 redirect 되지 않음

💡 Auth Provider 로직 개선

❓상황

  1. 페이지 접속 시 SSE 즉시 연결을 위해 AccessToken이 최신화 되어야 함
  2. 그 때문에 페이지 접속 or 새로고침 시 마다 accessToken이 없으면 refresh 요청을 실행함

❌ 문제

  • 페이지 접속 or 새로 고침 할 때마다 불필요한 refresh 요청 발생(로그아웃 상태에서도 refresh 요청 발생)

✅ 해결

  1. RootLayout에서 refreshToken 이 있는지 검사(hasRefreshToken)
  2. hasRefreshToken 을 AuthProvider로 전달, true 일 경우에만 Auth Provider의 refresh 로직 실행

🔍 결과

  • 새로고침 시 불필요한 refresh 요청이 발생하지 않음.

💡 프로필 페이지 로직 개선

❓ 상황

  • 접속한 프로필 페이지의 userId와 나의 userId를 비교해 id가 동일하면 /mypage로 redirect 필요

❌ 문제

  • 나의 프로필 페이지가 아닌 다른 페이지에 접속해도 계속 불필요한 내 정보 요청(userGetMe + refresh) 발생

✅ 해결

  • AuthProvider의 isAuthenticated 가 true인 경우에만 내 정보 요청 실행하도록 수정

🔍 결과

  • 로그아웃 상태에서는 프로필 페이지 접속 시 내 정보 를(userGetMe) 요청하지 않음

🔗 관련 이슈

Closes #


🧪 테스트 방법

  • 수동 테스트 검증(로컬 환경)
  • 유닛 테스트 검증
  • 통합 테스트 검증

📸 스크린샷 (선택)


📋 체크리스트

  • 관련 문서를 업데이트했습니다 (필요한 경우)
  • 테스트를 추가/수정했습니다 (필요한 경우)
  • Breaking change가 있다면 명시했습니다

💬 추가 코멘트


CodeRabbit Review는 자동으로 실행되지 않습니다.

Review를 실행하려면 comment에 아래와 같이 작성해주세요

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 31, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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.

@github-actions
Copy link

github-actions bot commented Dec 31, 2025

🎭 Playwright Report

E2E Test가 성공적으로 완료되었습니다.

Test 요약 내용을 확인해주세요.

Status Build Log Updated (UTC)
✅ Ready View Build 2025-12-31 14:20:08

📊 Test Summary

  • ✅ Passed: 3
  • ❌ Failed: 0
  • ⏱️ Duration: 27.7s

📜 Test Details

✅ Passed Tests (3)
  • profile.test.ts (3)
    • [chromium] 존재하지 않는 프로필 페이지로 접속 시 404 redirect 되는 지 테스트
    • [firefox] 존재하지 않는 프로필 페이지로 접속 시 404 redirect 되는 지 테스트
    • [webkit] 존재하지 않는 프로필 페이지로 접속 시 404 redirect 되는 지 테스트

@github-actions
Copy link

github-actions bot commented Dec 31, 2025

🎨 Storybook Report

변경 사항이 없습니다

모든 Story가 이전 빌드와 동일합니다.

Status Storybook Build Log Updated (UTC)
✅ Unchanged View Storybook View Build 2025-12-31 14:20:35

@github-actions
Copy link

github-actions bot commented Dec 31, 2025

📊 Coverage Report

Status Build Log Updated (UTC)
✅ Ready View Build 2025-12-31 14:19:07

📉 #294main에 병합하면 coverage가 0.53% 감소합니다.

Coverage 요약

@@             Coverage Diff             @@
##             main     #294       +/-   ##
===========================================
- Coverage   40.86%   40.33%    -0.53%     
===========================================
  Files         209      209         0     
  Lines        9367     9381       +14     
  Branches      423      406       -17     
===========================================
- Hits         3828     3784       -44     
+ Misses       5539     5597       +58     

영향받은 파일

파일 Coverage 변화
/home/runner/work/WeGo_FrontEnd/WeGo_FrontEnd/src/api/core/index.ts 50.80% (-12.99%) ⬇️
/home/runner/work/WeGo_FrontEnd/WeGo_FrontEnd/src/api/service/auth-service/index.ts 69.56% (-8.70%) ⬇️
/home/runner/work/WeGo_FrontEnd/WeGo_FrontEnd/src/api/service/user-service/index.ts 77.50% (-2.50%) ⬇️
/home/runner/work/WeGo_FrontEnd/WeGo_FrontEnd/src/hooks/use-user/use-user-get-me/index.ts 86.48% (-13.52%) ⬇️
/home/runner/work/WeGo_FrontEnd/WeGo_FrontEnd/src/mock/service/auth/auth-handlers.ts 34.25% (-11.12%) ⬇️
/home/runner/work/WeGo_FrontEnd/WeGo_FrontEnd/src/mock/service/common/common-mock.ts 57.69% (-42.31%) ⬇️
/home/runner/work/WeGo_FrontEnd/WeGo_FrontEnd/src/providers/provider-auth/index.tsx 84.61% (-9.50%) ⬇️

@github-actions
Copy link

github-actions bot commented Dec 31, 2025

🚀 PR Preview Report

Build가 성공적으로 완료되었습니다.

Preview에서 변경사항을 확인하세요.

Status Preview Build Log Updated (UTC)
✅ Ready Visit Preview View Logs 2025-12-31 14:20:19

@Chiman2937 Chiman2937 added the Ready For Review! 리뷰 받을 준비가 되었습니다. label Dec 31, 2025
Copy link
Contributor

@wooktori wooktori left a comment

Choose a reason for hiding this comment

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

아까 얘기해주셨던 부분이군요! 고생하셨습니다!!

@Chiman2937 Chiman2937 merged commit 8c712ca into main Dec 31, 2025
7 checks passed
@Chiman2937 Chiman2937 deleted the chiyoung-fix/auth-provider branch December 31, 2025 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready For Review! 리뷰 받을 준비가 되었습니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants