@@ -22,6 +22,7 @@ import androidx.compose.runtime.mutableStateOf
2222import androidx.compose.runtime.remember
2323import androidx.compose.runtime.rememberCoroutineScope
2424import androidx.compose.runtime.saveable.rememberSaveable
25+ import androidx.compose.ui.platform.LocalContext
2526import com.firebase.ui.auth.compose.configuration.AuthUIConfiguration
2627import com.firebase.ui.auth.compose.configuration.MfaConfiguration
2728import com.firebase.ui.auth.compose.configuration.MfaFactor
@@ -78,6 +79,7 @@ fun MfaEnrollmentScreen(
7879 " MfaEnrollmentScreen must be used within an Activity context for SMS verification"
7980 }
8081 val coroutineScope = rememberCoroutineScope()
82+ val applicationContext = LocalContext .current.applicationContext
8183
8284 val smsHandler = remember(activity, auth, user) { SmsEnrollmentHandler (activity, auth, user) }
8385 val totpHandler = remember(auth, user) { TotpEnrollmentHandler (auth, user) }
@@ -102,8 +104,9 @@ fun MfaEnrollmentScreen(
102104
103105 val resendTimerSeconds = rememberSaveable { mutableIntStateOf(0 ) }
104106
105- val phoneAuthConfiguration = remember(authConfiguration) {
107+ val phoneAuthConfiguration = remember(authConfiguration, applicationContext ) {
106108 authConfiguration ? : authUIConfiguration {
109+ context = applicationContext
107110 providers {
108111 provider(
109112 AuthProvider .Phone (
0 commit comments