hmkim 06-17
250617 김혜민 소셜로그인 콜백에러 수정
@1def9925ac17900e60eb32d6180b5190e9e10da7
client/views/pages/login/Login.vue
--- client/views/pages/login/Login.vue
+++ client/views/pages/login/Login.vue
@@ -99,21 +99,9 @@
 
   async mounted() {
       await this.$nextTick();
-      console.log('URL:', window.location.href);
-      
-      const hasParams = window.location.search.includes('oauth_success') || 
-                      window.location.search.includes('error');
-      console.log('hasOAuthParams:', hasParams);
-      
-      if (hasParams) {
-          console.log('OAuth 콜백 실행 시작!');
-          try {
-              await this.handleOAuthCallback();
-              console.log('OAuth 콜백 완료!');
-          } catch (error) {
-              console.error('OAuth 콜백 에러:', error);
-          }
-        }
+      if (this.hasOAuthParams()) {
+        await this.handleOAuthCallback();
+      }
     },
   beforeUnmount() {
     this.isOAuthLoading = false;
@@ -322,11 +310,7 @@
           headers['Authorization'] = token.startsWith('Bearer ') ? token : `Bearer ${token}`;
         }
         
-        const response = await fetch('/oauth2/getUserInfo.json', {
-          method: 'POST',
-          headers: headers,
-          credentials: 'include'
-        });
+        const response = await getUserInfo();
         
         if (response.status === 200) {
           const result = await response.json();
@@ -358,14 +342,7 @@
     async handleOAuthSession() {
       try {
         
-        const userInfoRes = await fetch('/oauth2/getUserInfo.json', {
-          method: 'POST',
-          credentials: 'include',
-          headers: {
-            'Content-Type': 'application/json',
-            'Cache-Control': 'no-cache'
-          }
-        });
+        const userInfoRes = await getUserInfo();
         
         if (!userInfoRes || userInfoRes.status !== 200) {
           throw new Error('세션 정보를 가져올 수 없습니다.');
Add a comment
List