import { useState } from 'react' import FormErrors from '../components/FormErrors' import { signUp } from '../lib/allauth' import { Link } from 'react-router-dom' import { useConfig } from '../auth' import ProviderList from '../socialaccount/ProviderList' import Button from '../components/Button' export default function Signup () { const [email, setEmail] = useState('') const [password1, setPassword1] = useState('') const [password2, setPassword2] = useState('') const [password2Errors, setPassword2Errors] = useState([]) const [response, setResponse] = useState({ fetching: false, content: null }) const config = useConfig() const hasProviders = config.data.socialaccount?.providers?.length > 0 function submit () { if (password2 !== password1) { setPassword2Errors([{ param: 'password2', message: 'Password does not match.' }]) return } setPassword2Errors([]) setResponse({ ...response, fetching: true }) signUp({ email, password: password1 }).then((content) => { setResponse((r) => { return { ...r, content } }) }).catch((e) => { console.error(e) window.alert(e) }).then(() => { setResponse((r) => { return { ...r, fetching: false } }) }) } return (

Sign Up

Already have an account? Login here.

Sign up using a passkey {hasProviders ? <>

Or use a third-party

: null}
) }