diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index f6c36ca58..0d2f7a580 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -5,7 +5,7 @@ import { FileContextProvider } from './contexts/FileContext'; import { FilesModalProvider } from './contexts/FilesModalContext'; import { AuthProvider } from './lib/useSession'; import HomePage from './pages/HomePage'; -import Login from './routes/Login'; +import LoginCompact from './routes/LoginCompact'; import AuthCallback from './routes/AuthCallback'; import AuthDebug from './routes/AuthDebug'; @@ -21,7 +21,7 @@ export default function App() { } /> - } /> + } /> } /> } /> {/* Catch-all route - redirects unknown paths to home */} diff --git a/frontend/src/routes/AuthDebug.tsx b/frontend/src/routes/AuthDebug.tsx index 42beba9e1..f1488a1a2 100644 --- a/frontend/src/routes/AuthDebug.tsx +++ b/frontend/src/routes/AuthDebug.tsx @@ -92,19 +92,29 @@ export default function AuthDebug() { alert(`Cleared ${keys.length} auth-related localStorage keys`) } - const testSignIn = async () => { + const testSignIn = async (provider: 'github' | 'google' | 'facebook' = 'github') => { try { + // Supabase redirects back to your app after OAuth const redirectTo = `${window.location.origin}/auth/callback` + const { error } = await supabase.auth.signInWithOAuth({ - provider: 'github', - options: { redirectTo } + provider, + options: { + redirectTo, + queryParams: provider === 'facebook' + ? { scope: 'email' } + : { + access_type: 'offline', + prompt: 'consent', + } + } }) if (error) { - alert(`Sign in test failed: ${error.message}`) + alert(`${provider} sign in test failed: ${error.message}`) } } catch (err) { - alert(`Sign in test error: ${err instanceof Error ? err.message : 'Unknown error'}`) + alert(`${provider} sign in test error: ${err instanceof Error ? err.message : 'Unknown error'}`) } } @@ -248,6 +258,45 @@ export default function AuthDebug() { )} + {/* Prominent JWT Token Display */} + {session && ( +
+

+ 🔑 JWT Access Token +

+
+
+ +