import { useEffect } from 'react'; import { useNavigate } from 'react-router-dom'; import { useAuth } from '../contexts/AuthContext'; import { API_BASE_URL } from '../config'; import './LoginPage.css'; 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 (

DocNest

Collaborate in real time with your team

); } export default LoginPage;