From 05397ceffc117dc85aeb9681899e5e0f6c2b8b34 Mon Sep 17 00:00:00 2001 From: Zac Gaetano Date: Sat, 4 Apr 2026 23:47:54 -0400 Subject: [PATCH] Fix OAuth login flow for Claude Max --- frontend/src/App.jsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 8574678..c02f933 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -74,17 +74,24 @@ const App = () => { } }; + const [loginLoading, setLoginLoading] = useState(false); + const handleLogin = async () => { + setLoginLoading(true); try { const response = await fetch('/api/auth/login', { method: 'POST' }); const data = await response.json(); setAuthStatus(prev => ({ ...prev, ...data })); if (data.auth_url) { window.open(data.auth_url, '_blank'); + } else if (data.status === 'error') { + alert(data.message || 'Login failed. Check container logs.'); } } catch (error) { console.error('Error initiating login:', error); + alert('Failed to connect to auth endpoint'); } + setLoginLoading(false); }; const handleLogout = async () => { @@ -178,7 +185,9 @@ const App = () => { ) : authStatus?.status === 'pending' ? ( ⏳ Awaiting login… ) : ( - + )} {systemInfo && ( @@ -248,9 +257,10 @@ const App = () => {
Waiting for browser login…
+
Complete the login in the browser tab that opened, then come back here.
{authStatus.auth_url && ( - Open login page → + Click here if the browser tab didn't open → )}