Search code examples
customizationauth0multi-factor-authentication

Auth0: unable to find ways to customize "new universal login pages"


General need

  • customize the MFA widget using the new universal login flow
  • this is not equal to classic flow (where we have Auth0MFAWidget with a range of options as listed here)

Specific need (for the new universal login flow, not the classic universal login flow)

  • Is there a possibility to change the default country on the MFA-SMS enrollment prompt?
  • can we restrict the list of countries also?
  • below is the page that I am looking at, can be accessed here:

MFA prompt

Note:

  • Asking these for the new universal login flow, not the classic universal login flow

Solution

  • I raised a support ticket (from a paid company account) and got a reply:

    Is there a possibility to change the default country on the MFA-SMS enrollment prompt?

    • it is auto selected based on the ip of the user

    Can we restrict the list of countries also?

    • not available
    • workaround is to use JavaScript on the universal-page-template which hides specific countries using the DOM
    • something like:
        const allList = document.getElementsByTagName("ul")[0];
    
        Object.keys(allList.children).map(ch => { 
            if (allList.children[ch].innerText.search('Japan') !== -1){
            allList.children[ch].style.display = none;
            }
        });