This commit is contained in:
HyeongBaeYang committed 2026-02-02 18:51:43 +09:00
1 parent dc42d26e6b
commit 61892a5d93
3 files changed
+144 -2

No files matched your search

+13 -2
View File
@@ -10,6 +10,7 @@ import LoginSection from './pages/Login/LoginSection';
import GenerationFlow from './pages/Dashboard/GenerationFlow';
import SocialConnectSuccess from './pages/Social/SocialConnectSuccess';
import SocialConnectError from './pages/Social/SocialConnectError';
import YouTubeOAuthCallback from './pages/Social/YouTubeOAuthCallback';
import { crawlUrl, autocomplete, kakaoCallback, isLoggedIn, saveTokens, AutocompleteRequest } from './utils/api';
import { CrawlingResponse } from './types/api';
@@ -102,14 +103,19 @@ const App: React.FC = () => {
const accessToken = urlParams.get('access_token');
const refreshToken = urlParams.get('refresh_token');
const code = urlParams.get('code');
const currentPath = window.location.pathname;
// Social OAuth 콜백 경로는 여기서 처리하지 않음 (백엔드에서 처리)
const isSocialOAuthCallback = currentPath.includes('/social/oauth/') ||
currentPath.includes('/social/connect/');
// 백엔드에서 토큰을 URL 파라미터로 전달한 경우
if (accessToken && refreshToken && !isProcessingCallback) {
setIsProcessingCallback(true);
handleTokenCallback(accessToken, refreshToken);
}
// 기존 code 방식 (Redirect URI가 프론트엔드인 경우)
else if (code && !isProcessingCallback) {
// 기존 code 방식 (Redirect URI가 프론트엔드인 경우) - Social OAuth는 제외
else if (code && !isProcessingCallback && !isSocialOAuthCallback) {
setIsProcessingCallback(true);
handleKakaoCallback(code);
}
@@ -333,6 +339,11 @@ const App: React.FC = () => {
// Social OAuth 콜백 페이지 처리
const pathname = window.location.pathname;
// YouTube OAuth 콜백 처리 (Google에서 리다이렉트)
if (pathname === '/social/oauth/youtube/callback') {
return <YouTubeOAuthCallback />;
}
if (pathname === '/social/connect/success') {
return <SocialConnectSuccess />;
}