fix(auth): enable register tab switching
This commit is contained in:
@@ -20,6 +20,7 @@ export function AuthPage() {
|
||||
const [message, setMessage] = useState<string | null>(null)
|
||||
const [oauthError, setOauthError] = useState<string | null>(null)
|
||||
const [tab, setTab] = useState(0)
|
||||
const [isRegister, setIsRegister] = useState(false)
|
||||
const [showForgot, setShowForgot] = useState(false)
|
||||
const [searchParams, setSearchParams] = useSearchParams()
|
||||
const navigate = useNavigate()
|
||||
@@ -122,6 +123,7 @@ export function AuthPage() {
|
||||
}}
|
||||
onClick={() => {
|
||||
setTab(idx)
|
||||
if (idx === 0) setIsRegister(false)
|
||||
setMessage(null)
|
||||
setOauthError(null)
|
||||
}}
|
||||
@@ -142,7 +144,13 @@ export function AuthPage() {
|
||||
</Alert>
|
||||
)}
|
||||
|
||||
{tab === 0 && <AuthPasswordForm isRegister={false} onSuccess={() => navigate('/', { replace: true })} />}
|
||||
{tab === 0 && (
|
||||
<AuthPasswordForm
|
||||
isRegister={isRegister}
|
||||
onRegisterChange={setIsRegister}
|
||||
onSuccess={() => navigate('/', { replace: true })}
|
||||
/>
|
||||
)}
|
||||
{tab === 1 && <AuthCodeForm onSuccess={() => navigate('/', { replace: true })} />}
|
||||
|
||||
<Box sx={{ mt: 2, mb: 1, display: 'flex', justifyContent: 'center' }}>
|
||||
|
||||
Reference in New Issue
Block a user