Skip to content

The setAllowNewAccounts option for the email authentication provider does not work #2305

@nerocristallo

Description

@nerocristallo

I am updating the library from version 8.x.x to version 9.x.x and have encountered the following problem

It seems that the new version of the library no longer honors the 'setAllowNewAccounts' option.
When using the old version of the library, the sign-up button disappears when AllowNewAccounts is set to false.

Use the email authentication provider
List<AuthUI.IdpConfig> providers = List.of( new AuthUI.IdpConfig.EmailBuilder() .setAllowNewAccounts(false) .setDefaultEmail(defaultEmail) .setRequireName(false) .build());

Create and launch sign-in intent
Intent signInIntent = AuthUI.getInstance(AuthManager.getSharedInstance().getFirebaseApp()) .createSignInIntentBuilder() .setTheme(R.style.LoginTheme) .setCredentialManagerEnabled(true) .setAvailableProviders(providers) .build(); signInLauncher.launch(signInIntent);

The UI always shows both 'Sign up' and 'Sign in' buttons.

Image

My app does not allow users to sign up, so the presence of the "Sign up" button is confusing.

Even worse, if I press "Sign up" and enter an email address of an existing user, it displays an error message saying that the email address does not match.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions