import React, { useEffect } from 'react'; import LoginForm from './LoginForm'; import { useAuthContext } from '~/hooks/AuthContext'; import { useNavigate } from 'react-router-dom'; import { useLocalize } from '~/hooks'; import { useGetStartupConfig } from 'librechat-data-provider'; import { GoogleIcon, FacebookIcon, OpenIDIcon, GithubIcon, DiscordIcon } from '~/components'; import { getLoginError } from '~/utils'; function Login() { const { login, error, isAuthenticated } = useAuthContext(); const { data: startupConfig } = useGetStartupConfig(); const localize = useLocalize(); const navigate = useNavigate(); useEffect(() => { if (isAuthenticated) { navigate('/chat/new', { replace: true }); } }, [isAuthenticated, navigate]); return (
{' '} {localize('com_auth_no_account')}{' '} {localize('com_auth_sign_up')}
)} {startupConfig?.socialLoginEnabled && ( <>