import React from 'react'; import { useNavigate } from 'react-router-dom'; import { supabase, isSupabaseConfigured } from '../lib/supabase'; import { Button } from '../components/ui/button'; import { motion, AnimatePresence } from 'framer-motion'; const PROVIDERS = [ { id: 'github', label: 'GitHub' }, { id: 'discord', label: 'Discord' }, { id: 'google', label: 'Google' }, // Add more providers here if needed ]; const LoginProvidersPage = () => { const navigate = useNavigate(); // Ensure theme is correct on mount React.useEffect(() => { const theme = localStorage.getItem('theme'); document.documentElement.classList.remove('light', 'dark'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } else { document.documentElement.classList.add('light'); } }, []); const handleLogin = async (provider) => { if (!isSupabaseConfigured()) return alert('Supabase not configured. Set VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY'); const { error } = await supabase.auth.signInWithOAuth({ provider }); if (error) alert(error.message); }; return (
Log in to securely sync your habits across all your devices. Choose your preferred provider below.
(No posts or data will be shared without your consent.)