Firebaseui-web: Phone Authentication Limit country selector

Created on 25 Apr 2018  路  8Comments  路  Source: firebase/firebaseui-web

There is a way to set the default country. But can i limit the countries to one country or at least intercept the verification and show a message that a specific country is supported?

auth

Most helpful comment

We have been thinking about this feature. We should definitely support a mechanism to limit the countries in the country selector.

All 8 comments

We have been thinking about this feature. We should definitely support a mechanism to limit the countries in the country selector.

@bojeil-google thanks for the quick response.
I guess that i need to use some css and js for now.
The nice thing is that, the countries list is a button so i can add 'disabled' to it after setting the language but it would be more stable and secure if it was from the developers directly

I agree. We should definitely support this feature.

@bojeil-google is the list of countries protected by some kind of script?
I am trying to disable it using jquery but it's not working even though i can edit it in the browser and add "disabled" attribute to it. My web development skills are rusty but i tried multiple options such as:

   `$( document ).ready(function() {
    console.log($( ".firebaseui-country-selector" ));
    $( ".firebaseui-country-selector" ).prop( "disabled", true );

  });`

can you kindly instruct me to a temporary solution?

I updated the firebaseui.js file
It looks like i need to refresh my skills on jQuery and JS
thanks for the great plugin

I didn't completely test this but you can use CSS to hide a button. For example, this is how I hid the UK button:

button[data-listboxid="44-GB-0"] {
  display: none;
}

Added the ability to configure country selection for phone Auth in release v3.2.0.

@wti806 That is awesome.
Thanks for the support.

Was this page helpful?
0 / 5 - 0 ratings