Skip to content

Commit cf61c44

Browse files
committed
chore: 디버깅용 로그 삭제 및 주석처리
1 parent 7daddb0 commit cf61c44

3 files changed

Lines changed: 3 additions & 19 deletions

File tree

src/components/common/Header.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,14 @@ const Header: React.FC = () => {
1313
const logoutMutation = useLogout();
1414

1515
// 디버깅용 로그
16-
React.useEffect(() => {
17-
console.log('🎯 Header auth state:', { isAuthenticated, isLoading });
18-
}, [isAuthenticated, isLoading]);
16+
// React.useEffect(() => {
17+
// console.log('🎯 Header auth state:', { isAuthenticated, isLoading });
18+
// }, [isAuthenticated, isLoading]);
1919

2020
// 로그아웃 핸들러
2121
const handleLogout = async () => {
2222
try {
23-
console.log('🚪 User clicked logout button');
2423
await logoutMutation.mutateAsync();
25-
console.log('✅ Logout completed successfully');
2624
navigate('/'); // 로그아웃 후 홈으로 이동
2725
} catch (error) {
2826
console.error('❌ 로그아웃 실패:', error);

src/hooks/useAuth.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,8 @@ export const useLogout = () => {
5757
try {
5858
// 서버에 로그아웃 요청 (HttpOnly 쿠키 삭제)
5959
await authAPI.logout();
60-
console.log('✅ Logout API call successful');
6160
} catch (error) {
6261
// 서버 로그아웃 실패시에도 로컬 상태는 초기화
63-
console.warn('⚠️ Server logout failed, but clearing local state:', error);
6462
throw error; // 에러를 다시 던져서 UI에서 처리할 수 있도록
6563
}
6664
},
@@ -117,16 +115,9 @@ export const useAuth = () => {
117115
// 소셜 로그인 완료 처리 및 초기 상태 확인
118116
const initialCheck = async () => {
119117
try {
120-
console.log('🔍 Starting auth check...');
121-
122118
// API를 통한 인증 상태 확인
123119
const hasTokens = await tokenManager.checkAuthStatus();
124120

125-
console.log('🔍 Initial auth check:', {
126-
hasTokens,
127-
url: window.location.href
128-
});
129-
130121
setAuthState({
131122
isAuthenticated: hasTokens,
132123
isLoading: false,
@@ -150,7 +141,6 @@ export const useAuth = () => {
150141

151142
// 토큰 변경 이벤트 리스너 등록
152143
const handleTokenChange = (hasTokens: boolean) => {
153-
console.log('🔄 Token change event:', { hasTokens }); // 디버깅용
154144
setAuthState({
155145
isAuthenticated: hasTokens,
156146
isLoading: false,
@@ -162,13 +152,11 @@ export const useAuth = () => {
162152
// 소셜 로그인 후 리다이렉트 감지 (URL 변화 또는 포커스 복구 시 재확인)
163153
const handleVisibilityChange = () => {
164154
if (!document.hidden) {
165-
console.log('🔄 Page visibility changed, rechecking auth...');
166155
setTimeout(() => checkAuth(), 100);
167156
}
168157
};
169158

170159
const handleFocus = () => {
171-
console.log('🔄 Window focused, rechecking auth...');
172160
setTimeout(() => checkAuth(), 100);
173161
};
174162

src/utils/axiosConfig.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ const processQueue = (error: any, token: string | null = null) => {
3636
apiClient.interceptors.request.use(
3737
(config: InternalAxiosRequestConfig) => {
3838
// HttpOnly 쿠키는 브라우저가 자동으로 포함시킴
39-
console.log(`🔄 API Request: ${config.method?.toUpperCase()} ${config.url}`);
4039
return config;
4140
},
4241
(error) => {
@@ -47,7 +46,6 @@ apiClient.interceptors.request.use(
4746
// Response interceptor to handle token refresh
4847
apiClient.interceptors.response.use(
4948
(response: AxiosResponse) => {
50-
console.log(`✅ API Response: ${response.config.method?.toUpperCase()} ${response.config.url} - ${response.status}`);
5149
return response;
5250
},
5351
async (error) => {

0 commit comments

Comments
 (0)