import { useEffect } from 'react'; import { useNavigate } from 'react-router-dom'; import { useAuth } from '../contexts/AuthContext'; import './LoginPage.css'; const API_BASE_URL = import.meta.env.VITE_API_URL || "http://localhost:8080/api"; function LoginPage() { const { user, loading } = useAuth(); const navigate = useNavigate(); useEffect(() => { if (!loading && user) { navigate('/'); } }, [user, loading, navigate]); const handleGoogleLogin = () => { window.location.href = `${API_BASE_URL}/auth/google`; }; const handleGitHubLogin = () => { window.location.href = `${API_BASE_URL}/auth/github`; }; if (loading) { return (

Loading...

); } return (

Realtime Collab

Collaborate in real-time with your team

); } export default LoginPage;