

250617 김혜민 소셜로그인 콜백에러 수정
@1def9925ac17900e60eb32d6180b5190e9e10da7
--- client/views/pages/login/Login.vue
+++ client/views/pages/login/Login.vue
... | ... | @@ -99,21 +99,9 @@ |
99 | 99 |
|
100 | 100 |
async mounted() { |
101 | 101 |
await this.$nextTick(); |
102 |
- console.log('URL:', window.location.href); |
|
103 |
- |
|
104 |
- const hasParams = window.location.search.includes('oauth_success') || |
|
105 |
- window.location.search.includes('error'); |
|
106 |
- console.log('hasOAuthParams:', hasParams); |
|
107 |
- |
|
108 |
- if (hasParams) { |
|
109 |
- console.log('OAuth 콜백 실행 시작!'); |
|
110 |
- try { |
|
111 |
- await this.handleOAuthCallback(); |
|
112 |
- console.log('OAuth 콜백 완료!'); |
|
113 |
- } catch (error) { |
|
114 |
- console.error('OAuth 콜백 에러:', error); |
|
115 |
- } |
|
116 |
- } |
|
102 |
+ if (this.hasOAuthParams()) { |
|
103 |
+ await this.handleOAuthCallback(); |
|
104 |
+ } |
|
117 | 105 |
}, |
118 | 106 |
beforeUnmount() { |
119 | 107 |
this.isOAuthLoading = false; |
... | ... | @@ -322,11 +310,7 @@ |
322 | 310 |
headers['Authorization'] = token.startsWith('Bearer ') ? token : `Bearer ${token}`; |
323 | 311 |
} |
324 | 312 |
|
325 |
- const response = await fetch('/oauth2/getUserInfo.json', { |
|
326 |
- method: 'POST', |
|
327 |
- headers: headers, |
|
328 |
- credentials: 'include' |
|
329 |
- }); |
|
313 |
+ const response = await getUserInfo(); |
|
330 | 314 |
|
331 | 315 |
if (response.status === 200) { |
332 | 316 |
const result = await response.json(); |
... | ... | @@ -358,14 +342,7 @@ |
358 | 342 |
async handleOAuthSession() { |
359 | 343 |
try { |
360 | 344 |
|
361 |
- const userInfoRes = await fetch('/oauth2/getUserInfo.json', { |
|
362 |
- method: 'POST', |
|
363 |
- credentials: 'include', |
|
364 |
- headers: { |
|
365 |
- 'Content-Type': 'application/json', |
|
366 |
- 'Cache-Control': 'no-cache' |
|
367 |
- } |
|
368 |
- }); |
|
345 |
+ const userInfoRes = await getUserInfo(); |
|
369 | 346 |
|
370 | 347 |
if (!userInfoRes || userInfoRes.status !== 200) { |
371 | 348 |
throw new Error('세션 정보를 가져올 수 없습니다.'); |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?