Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/stores/useAuthStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ export const useAuthStore = create<AuthState>()(
const { accessToken } = useAuthStore.getState();
try {
await logoutApi(accessToken);
} catch (error) {
console.error('로그아웃 API 호출 실패:', error);
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

민감한 오류 객체를 그대로 콘솔에 출력하지 않는 것이 좋습니다.

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.

Suggested change
} 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.

} finally {
Storage.removeItem(TOKEN.ACCESS);
set({
Expand Down