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