-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: #303 로그인 요청에 withCredentials 설정 추가 #304
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Walkthrough
Changes
Assessment against linked issues
Poem
Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
src/services/authService.ts (1)
Line range hint
66-68
: 소셜 로그인에도 withCredentials 설정이 필요합니다현재
socialLogin
함수에는withCredentials
설정이 누락되어 있습니다. 소셜 로그인도 인증 쿠키를 처리해야 하므로, 다른 인증 관련 엔드포인트와 동일하게 설정이 필요합니다.export async function socialLogin(provider: SocialLoginProvider, code: string, axiosConfig: AxiosRequestConfig = {}) { - return defaultAxios.post(`user/login/${provider}`, { code }, axiosConfig); + return defaultAxios.post(`user/login/${provider}`, { code }, { ...axiosConfig, withCredentials: true }); }
🧹 Nitpick comments (2)
src/services/authService.ts (2)
Line range hint
77-77
: 토큰 갱신 요청의 보안 강화가 필요합니다
withCredentials
설정이 올바르게 추가되었습니다. 토큰 갱신 과정의 보안을 더욱 강화하기 위해 다음 사항들도 고려해보시기 바랍니다:
- 리프레시 토큰의 만료 시간 검증
- 토큰 갱신 실패 시 자동 로그아웃 처리
- 동시 다발적인 토큰 갱신 요청 방지 (토큰 갱신 중복 방지)
Line range hint
102-102
: 로그아웃 시 세션 정리가 필요합니다
withCredentials
설정이 올바르게 추가되었습니다. 로그아웃 기능의 완성도를 높이기 위해 다음 작업들도 함께 수행되는지 확인해주세요:
- 클라이언트 측 저장소(localStorage, sessionStorage) 정리
- 메모리에 저장된 인증 상태 초기화
- 쿠키 삭제 확인
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/services/authService.ts
(1 hunks)
🔇 Additional comments (1)
src/services/authService.ts (1)
54-54
: CORS 설정 확인이 필요합니다
withCredentials: true
설정이 올바르게 추가되었습니다. 하지만 이 설정이 제대로 작동하려면 백엔드 서버에서도 적절한 CORS 설정이 필요합니다.
서버 측에서 다음 설정이 되어있는지 확인해주세요:
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin
이 와일드카드(*
)가 아닌 구체적인 오리진으로 설정
PR Type
What kind of change does this PR introduce?
Related Issues
www.growup.kr
)에서 쿠키가 생성되지 않는 문제 #303What does this PR do?
withCredential : true
설정 추가Other information
참고자료