From ef4c23d6a2b0cb9ecd08562df6fcad3e8b12a472 Mon Sep 17 00:00:00 2001 From: Tetardtek Date: Sun, 15 Mar 2026 03:30:49 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20OAuth=20=E2=80=94=20window.location.href?= =?UTF-8?q?=20direct,=20no=20cross-origin=20fetch=20(CORS)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/LoginPage.tsx | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/frontend/src/pages/LoginPage.tsx b/frontend/src/pages/LoginPage.tsx index b53fecb..69d2bdf 100644 --- a/frontend/src/pages/LoginPage.tsx +++ b/frontend/src/pages/LoginPage.tsx @@ -24,18 +24,10 @@ export default function LoginPage() { const [error, setError] = useState(null); const [oauthLoading, setOauthLoading] = useState(null); - async function handleOAuth(providerId: string) { + function handleOAuth(providerId: string) { if (oauthLoading) return; setOauthLoading(providerId); - try { - const res = await fetch(`${base}/api/v1/oauth/${providerId}?redirectUrl=${redirectUrl}`); - const data = await res.json() as { success: boolean; data?: { authUrl?: string } }; - if (data.data?.authUrl) { - window.location.href = data.data.authUrl; - } - } catch { - setOauthLoading(null); - } + window.location.href = `${base}/api/v1/oauth/${providerId}?redirectUrl=${redirectUrl}`; } async function handleSubmit(e: React.FormEvent) {