factor && challengeAndVerify({ factorId: factor.id, code })}
+ onConfirm={form.handleSubmit(onSubmit)}
>
-
-
- Use an authenticator app to scan the following QR code, and provide the code from the app
- to complete the enrolment.
-
-
+
+ Use an authenticator app to scan the following QR code, and provide the code from the app to
+ complete the enrolment.
+
+
{isLoading && (
)}
+
{factor && (
- <>
+
-
-
- }
- />
-
-
- setCode(e.target.value)}
- />
-
- >
+
+
+ }
+ />
+
+
+
+
+
)}
)
diff --git a/apps/studio/components/interfaces/SignIn/SignInMfaForm.tsx b/apps/studio/components/interfaces/SignIn/SignInMfaForm.tsx
index d14f1f645ce..f408cdbaadb 100644
--- a/apps/studio/components/interfaces/SignIn/SignInMfaForm.tsx
+++ b/apps/studio/components/interfaces/SignIn/SignInMfaForm.tsx
@@ -11,7 +11,7 @@ import { getReturnToPath } from 'lib/gotrue'
import { Lock } from 'lucide-react'
import Link from 'next/link'
import { useRouter } from 'next/router'
-import { useEffect, useState } from 'react'
+import { useEffect, useRef, useState } from 'react'
import { SubmitHandler, useForm } from 'react-hook-form'
import { Button, Form_Shadcn_, FormControl_Shadcn_, FormField_Shadcn_, Input_Shadcn_ } from 'ui'
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
@@ -34,12 +34,15 @@ export const SignInMfaForm = ({ context = 'sign-in' }: SignInMfaFormProps) => {
const router = useRouter()
const signOut = useSignOut()
const queryClient = useQueryClient()
+
const [selectedFactor, setSelectedFactor] = useState