@@ -22,6 +22,7 @@ import com.firebase.ui.auth.compose.FirebaseAuthUI
2222import com.firebase.ui.auth.compose.configuration.PasswordRule
2323import com.firebase.ui.auth.compose.configuration.authUIConfiguration
2424import com.firebase.ui.auth.compose.configuration.auth_provider.AuthProvider
25+ import com.firebase.ui.auth.compose.configuration.string_provider.LocalAuthUIStringProvider
2526import com.firebase.ui.auth.compose.configuration.theme.AuthUIAsset
2627import com.firebase.ui.auth.compose.configuration.theme.AuthUITheme
2728import com.firebase.ui.auth.compose.ui.screens.EmailAuthContentState
@@ -275,22 +276,25 @@ fun EmailAuthDemo(
275276 }
276277 } else {
277278 // Show custom email auth UI using slot API
278- EmailAuthScreen (
279- context = context,
280- configuration = configuration,
281- authUI = authUI,
282- onSuccess = { result: AuthResult ->
283- Log .d(" CustomSlotsDemo" , " Email auth success: ${result.user?.uid} " )
284- },
285- onError = { exception: AuthException ->
286- Log .e(" CustomSlotsDemo" , " Email auth error" , exception)
287- },
288- onCancel = {
289- Log .d(" CustomSlotsDemo" , " Email auth cancelled" )
279+ // Provide the string provider required by EmailAuthScreen
280+ CompositionLocalProvider (LocalAuthUIStringProvider provides configuration.stringProvider) {
281+ EmailAuthScreen (
282+ context = context,
283+ configuration = configuration,
284+ authUI = authUI,
285+ onSuccess = { result: AuthResult ->
286+ Log .d(" CustomSlotsDemo" , " Email auth success: ${result.user?.uid} " )
287+ },
288+ onError = { exception: AuthException ->
289+ Log .e(" CustomSlotsDemo" , " Email auth error" , exception)
290+ },
291+ onCancel = {
292+ Log .d(" CustomSlotsDemo" , " Email auth cancelled" )
293+ }
294+ ) { state: EmailAuthContentState ->
295+ // Custom UI using the slot API
296+ CustomEmailAuthUI (state)
290297 }
291- ) { state: EmailAuthContentState ->
292- // Custom UI using the slot API
293- CustomEmailAuthUI (state)
294298 }
295299 }
296300}
@@ -609,22 +613,25 @@ fun PhoneAuthDemo(
609613 }
610614 } else {
611615 // Show custom phone auth UI using slot API
612- PhoneAuthScreen (
613- context = context,
614- configuration = configuration,
615- authUI = authUI,
616- onSuccess = { result: AuthResult ->
617- Log .d(" CustomSlotsDemo" , " Phone auth success: ${result.user?.uid} " )
618- },
619- onError = { exception: AuthException ->
620- Log .e(" CustomSlotsDemo" , " Phone auth error" , exception)
621- },
622- onCancel = {
623- Log .d(" CustomSlotsDemo" , " Phone auth cancelled" )
616+ // Provide the string provider required by PhoneAuthScreen
617+ CompositionLocalProvider (LocalAuthUIStringProvider provides configuration.stringProvider) {
618+ PhoneAuthScreen (
619+ context = context,
620+ configuration = configuration,
621+ authUI = authUI,
622+ onSuccess = { result: AuthResult ->
623+ Log .d(" CustomSlotsDemo" , " Phone auth success: ${result.user?.uid} " )
624+ },
625+ onError = { exception: AuthException ->
626+ Log .e(" CustomSlotsDemo" , " Phone auth error" , exception)
627+ },
628+ onCancel = {
629+ Log .d(" CustomSlotsDemo" , " Phone auth cancelled" )
630+ }
631+ ) { state: PhoneAuthContentState ->
632+ // Custom UI using the slot API
633+ CustomPhoneAuthUI (state)
624634 }
625- ) { state: PhoneAuthContentState ->
626- // Custom UI using the slot API
627- CustomPhoneAuthUI (state)
628635 }
629636 }
630637}
0 commit comments