import { useEffect } from 'react'; import LoginForm from './LoginForm'; import { useAuthContext } from '~/hooks/AuthContext'; import { useNavigate } from 'react-router-dom'; import { SHOW_GOOGLE_LOGIN_OPTION, ALLOW_REGISTRATION, DOMAIN_SERVER } from "~/utils/envConstants"; function Login() { const { login, error, isAuthenticated } = useAuthContext(); const navigate = useNavigate(); useEffect(() => { if (isAuthenticated) { navigate('/chat/new'); } }, [isAuthenticated, navigate]); return (
{' '} Don't have an account?{' '} Sign up
)} {SHOW_GOOGLE_LOGIN_OPTION && ( <>