diff --git a/web/components/login-form.tsx b/web/components/login-form.tsx index 21d8456..75df2f8 100644 --- a/web/components/login-form.tsx +++ b/web/components/login-form.tsx @@ -40,17 +40,14 @@ export function LoginForm({ const { session } = useAuth() const [isPending, setIsPending] = useState(false) const [isWxWorkEnv, setIsWxWorkEnv] = useState(false) - const [authOptions, setAuthOptions] = useState({ - wxworkEnabled: false, - oidcEnabled: false, - }) + const [authOptions, setAuthOptions] = useState(null) const nextPath = searchParams.get("next") const wxworkError = searchParams.get("wxworkError") const oidcError = searchParams.get("oidcError") const redirectPath = nextPath && nextPath.startsWith("/") ? nextPath : "/dashboard" const enabledProviderCount = - Number(authOptions.wxworkEnabled) + Number(authOptions.oidcEnabled) + Number(authOptions?.wxworkEnabled) + Number(authOptions?.oidcEnabled) useEffect(() => { if (session) { @@ -115,6 +112,10 @@ export function LoginForm({ } } + if (!authOptions) { + return null + } + return (