mirror of
https://github.com/formbricks/formbricks.git
synced 2026-03-13 11:09:29 -05:00
fix: Error message on Login not shown (#1508)
This commit is contained in:
committed by
GitHub
parent
ccfd5ae28b
commit
7d0ebd3c54
@@ -6,7 +6,7 @@ import { XCircleIcon } from "@heroicons/react/24/solid";
|
||||
import { signIn } from "next-auth/react";
|
||||
import Link from "next/dist/client/link";
|
||||
import { useRouter, useSearchParams } from "next/navigation";
|
||||
import { useMemo, useRef, useState } from "react";
|
||||
import { useMemo, useRef, useState, useEffect } from "react";
|
||||
import { Controller, SubmitHandler, useForm, FormProvider } from "react-hook-form";
|
||||
|
||||
import { cn } from "@formbricks/lib/cn";
|
||||
@@ -88,10 +88,16 @@ export const SigninForm = ({
|
||||
const [totpBackup, setTotpBackup] = useState(false);
|
||||
const [signInError, setSignInError] = useState("");
|
||||
const formRef = useRef<HTMLFormElement>(null);
|
||||
|
||||
const error = searchParams?.get("error");
|
||||
const callbackUrl = searchParams?.get("callbackUrl");
|
||||
const inviteToken = callbackUrl ? new URL(callbackUrl).searchParams.get("token") : null;
|
||||
|
||||
useEffect(() => {
|
||||
if (error) {
|
||||
setSignInError(error);
|
||||
}
|
||||
}, []);
|
||||
|
||||
const formLabel = useMemo(() => {
|
||||
if (totpBackup) {
|
||||
return "Enter your backup code";
|
||||
|
||||
Reference in New Issue
Block a user