diff --git a/cmd/server/assets/login/register-phone.html b/cmd/server/assets/login/register-phone.html index 86db7e6c9..b8ce9e452 100644 --- a/cmd/server/assets/login/register-phone.html +++ b/cmd/server/assets/login/register-phone.html @@ -39,20 +39,19 @@

-
- - +
+ - Fully qualified phone number beginning with '+'. Standard SMS rates may apply. + You will be asked to confirm a code using this phone number at login. + Standard SMS rates may apply. -
+
- Name for this phone. + Display name for this phone.
@@ -106,6 +105,16 @@ let verId = "" + // Initialize pretty phone + let phone = document.querySelector('#phone'); + let iti = window.intlTelInput(phone, { + nationalMode: true, + {{- if $currentRealm.SMSCountry }} + initialCountry: '{{$currentRealm.SMSCountry}}', + {{- end }} + utilsScript: 'https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.0/js/utils.js', + }); + firebase.auth().onAuthStateChanged(function(user) { if (!user) { window.location.assign("/signout"); @@ -195,7 +204,7 @@ user.multiFactor.getSession().then(function(multiFactorSession) { // Specify the phone number and pass the MFA session. var phoneInfoOptions = { - phoneNumber: $phone.val(), + phoneNumber: iti.getNumber(), session: multiFactorSession }; var phoneAuthProvider = new firebase.auth.PhoneAuthProvider();