Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
Walkthrough로그아웃 흐름에서 정리(cleanup)와 상태 초기화 위치가 변경되고, logout API 오류 처리와 네비게이션 호출이 파일별로 조정되었습니다. 구체적으로: Changes
Sequence Diagram(s)sequenceDiagram
participant User as User (클릭)
participant Nav as NavItemList
participant Auth as useAuthStore
participant Storage as Storage
participant API as logoutApi
participant Router as Router
User->>Nav: 로그아웃 버튼 클릭
Nav->>Auth: logout()
Auth->>Storage: accessToken 확인 및 Storage.removeItem(), 상태 초기화
Auth->>API: logoutApi(accessToken)
API-->>Auth: (응답 또는 오류)
Auth-->>Nav: 반환/종료
Nav->>Router: router.push(ROUTES.MAIN) (finally)
(위 다이어그램은 변경된 흐름을 간단히 시각화합니다 — cleanup이 API 호출 이전에 수행되고, 네비게이션은 finally에서 항상 실행됩니다.) 예상 코드 리뷰 난이도🎯 3 (Moderate) | ⏱️ ~20 minutes 시
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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.
Pull request overview
로그아웃 API 호출 성공 여부와 무관하게 클라이언트 인증 상태 정리(토큰 삭제/스토어 초기화)가 진행되도록 logout() 흐름을 조정한 변경입니다. 기존에는 logoutApi() 실패 시 finally는 실행되더라도 예외가 재전파되어 호출부에서 리다이렉트 등의 후속 처리가 끊길 수 있었는데, 이를 방지합니다.
Changes:
logoutApi()실패를catch에서 처리하여logout()가 reject되지 않도록 변경- 실패 시 콘솔 에러 로그를 남기도록 추가
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/stores/useAuthStore.ts`:
- Around line 37-38: The catch block in the logout flow (in useAuthStore.ts —
the catch handling around the logout API call) currently logs the entire error
object to console which can expose sensitive request metadata; change the
handler to log only a sanitized message and non-sensitive fields (e.g.,
error.message or a trimmed string) or a fixed message, and forward the full
error to a secure monitoring system if needed; update the catch in the
logout/signOut function to replace console.error('로그아웃 API 호출 실패:', error) with
a safe log that avoids printing headers/tokens and includes only minimal
context.
src/stores/useAuthStore.ts
Outdated
| } catch (error) { | ||
| console.error('로그아웃 API 호출 실패:', error); |
There was a problem hiding this comment.
민감한 오류 객체를 그대로 콘솔에 출력하지 않는 것이 좋습니다.
Line 38에서 error 객체 전체를 로그로 남기면 브라우저 콘솔에 요청 메타데이터(예: 헤더/토큰 관련 정보)가 노출될 수 있습니다. 운영 환경에서는 정제된 메시지만 기록하도록 제한해 주세요.
🔧 제안 수정안
} catch (error) {
- console.error('로그아웃 API 호출 실패:', error);
+ if (process.env.NODE_ENV === 'development') {
+ console.error('로그아웃 API 호출 실패');
+ }
} finally {📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| } catch (error) { | |
| console.error('로그아웃 API 호출 실패:', error); | |
| } catch (error) { | |
| if (process.env.NODE_ENV === 'development') { | |
| console.error('로그아웃 API 호출 실패'); | |
| } | |
| } finally { |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/stores/useAuthStore.ts` around lines 37 - 38, The catch block in the
logout flow (in useAuthStore.ts — the catch handling around the logout API call)
currently logs the entire error object to console which can expose sensitive
request metadata; change the handler to log only a sanitized message and
non-sensitive fields (e.g., error.message or a trimmed string) or a fixed
message, and forward the full error to a secure monitoring system if needed;
update the catch in the logout/signOut function to replace console.error('로그아웃
API 호출 실패:', error) with a safe log that avoids printing headers/tokens and
includes only minimal context.
📄 Summary
🔨 Tasks
🙋🏻 More
Summary by CodeRabbit