@@ -6,7 +6,7 @@ import { useUI } from "@invertase/firebaseui-react";
66import { Card , CardContent , CardHeader , CardDescription , CardTitle } from "@/components/ui/card" ;
77import { Separator } from "@/components/ui/separator" ;
88import { PhoneAuthForm , type PhoneAuthFormProps } from "@/components/phone-auth-form" ;
9- import { MultiFactorAuthAssertionForm } from "@/components/multi-factor-auth-assertion-form " ;
9+ import { MultiFactorAuthAssertionScreen } from "@/components/multi-factor-auth-assertion-screen " ;
1010import { RedirectError } from "@/components/redirect-error" ;
1111
1212export type PhoneAuthScreenProps = PropsWithChildren < PhoneAuthFormProps > ;
@@ -18,6 +18,10 @@ export function PhoneAuthScreen({ children, ...props }: PhoneAuthScreenProps) {
1818 const subtitleText = getTranslation ( ui , "prompts" , "signInToAccount" ) ;
1919 const mfaResolver = ui . multiFactorResolver ;
2020
21+ if ( mfaResolver ) {
22+ return < MultiFactorAuthAssertionScreen onSuccess = { props . onSignIn } /> ;
23+ }
24+
2125 return (
2226 < div className = "max-w-sm mx-auto" >
2327 < Card >
@@ -26,26 +30,16 @@ export function PhoneAuthScreen({ children, ...props }: PhoneAuthScreenProps) {
2630 < CardDescription > { subtitleText } </ CardDescription >
2731 </ CardHeader >
2832 < CardContent >
29- { mfaResolver ? (
30- < MultiFactorAuthAssertionForm
31- onSuccess = { ( credential ) => {
32- props . onSignIn ?.( credential ) ;
33- } }
34- />
35- ) : (
33+ < PhoneAuthForm { ...props } />
34+ { children ? (
3635 < >
37- < PhoneAuthForm { ...props } />
38- { children ? (
39- < >
40- < Separator className = "my-4" />
41- < div className = "space-y-2" >
42- { children }
43- < RedirectError />
44- </ div >
45- </ >
46- ) : null }
36+ < Separator className = "my-4" />
37+ < div className = "space-y-2" >
38+ { children }
39+ < RedirectError />
40+ </ div >
4741 </ >
48- ) }
42+ ) : null }
4943 </ CardContent >
5044 </ Card >
5145 </ div >
0 commit comments