Skip to content

feat(auth): add customMethodPickerTermsContent slot to FirebaseAuthScreen#2330

Merged
demolaf merged 6 commits into
version-10.0.0-beta03from
feature/tos-checkbox
Jun 5, 2026
Merged

feat(auth): add customMethodPickerTermsContent slot to FirebaseAuthScreen#2330
demolaf merged 6 commits into
version-10.0.0-beta03from
feature/tos-checkbox

Conversation

@demolaf
Copy link
Copy Markdown
Member

@demolaf demolaf commented Jun 4, 2026

Closes #1338

Adds a customMethodPickerTermsContent slot to FirebaseAuthScreen (and termsContent to AuthMethodPicker) so developers can replace the default "By continuing..." footer with their own UI — e.g. an explicit acceptance checkbox required by some jurisdictions (GDPR, French law).

Usage

On FirebaseAuthScreen composable:

customMethodPickerTermsConfiguration = MethodPickerTermsConfiguration(
    content = {
        Row(
            modifier = Modifier.padding(horizontal = 16.dp, vertical = 8.dp),
            verticalAlignment = Alignment.CenterVertically
        ) {
            Checkbox(
                checked = termsAccepted,
                onCheckedChange = { termsAccepted = it }
            )
            Text(
                text = "I have read and accept the Terms of Service and Privacy Policy",
                style = MaterialTheme.typography.bodySmall,
                modifier = Modifier.padding(start = 8.dp)
            )
        }
    },
    accepted = termsAccepted,
    disableProvidersUntilAccepted = true,
),

Preview

untitled.webm

@demolaf demolaf linked an issue Jun 4, 2026 that may be closed by this pull request
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the ability to customize the Terms of Service and Privacy Policy footer in the authentication method picker by adding a customMethodPickerTermsContent parameter to FirebaseAuthScreen and AuthMethodPicker. However, the current implementation introduces a breaking change where the default ToS footer is hidden when a customLayout is provided without a custom terms composable. Additionally, there is a functional gap where the state of a custom terms checkbox cannot be used to gate or disable the default sign-in buttons, which is critical for compliance. Finally, the unit tests should be updated to reflect the corrected behavior once these issues are addressed.

Comment thread auth/src/main/java/com/firebase/ui/auth/ui/method_picker/AuthMethodPicker.kt Outdated
Comment thread auth/src/main/java/com/firebase/ui/auth/ui/screens/FirebaseAuthScreen.kt Outdated
@demolaf demolaf marked this pull request as draft June 4, 2026 15:45
@demolaf demolaf marked this pull request as ready for review June 5, 2026 09:16
@demolaf demolaf requested a review from just1and0 June 5, 2026 09:56
Copy link
Copy Markdown

@just1and0 just1and0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When disableProvidersUntilAccepted is true, this only disables the default provider buttons. Custom layouts still receive the raw onProviderSelected callback, so they can start auth before terms are accepted. Since this is meant to enforce explicit consent, should we wrap the callback and pass the gated version to both the default layout and custom layouts or is this expected behaviour ?

Comment thread app/src/main/java/com/firebaseui/android/demo/CustomSlotsThemingDemoActivity.kt Outdated
@demolaf
Copy link
Copy Markdown
Member Author

demolaf commented Jun 5, 2026

When disableProvidersUntilAccepted is true, this only disables the default provider buttons. Custom layouts still receive the raw onProviderSelected callback, so they can start auth before terms are accepted. Since this is meant to enforce explicit consent, should we wrap the callback and pass the gated version to both the default layout and custom layouts or is this expected behaviour ?

If the user has chosen to provide their own layout then they would be responsible for handling the behaviour of onProviderSelected, if we gate this then this takes away control from the user.

This is the intended behaviour.

@demolaf demolaf requested a review from just1and0 June 5, 2026 11:56
@demolaf demolaf merged commit 000e208 into version-10.0.0-beta03 Jun 5, 2026
10 checks passed
@demolaf demolaf mentioned this pull request Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Checkbox to accept Terms

2 participants