Mandatory country field when signing up

Hi all!
I need the country of a user. I would like to have it as a mandatory field when signing up. I use the hosted sign up page of Auth0 (loginWithRedirect). I don’t see an option to show such a field. Is there a possibility?

Thanks!

Hi, any information on this? I found this article: Adding Country to a User's Profile with Auth0 Rules
But it is a solution with rules which are now deprecated.

Hi, has anyone an idea how to implement this?

Hi @DenverKrueger

Welcome to the Auth0 Community!

Sorry for the late response to your question.

In the Action event.request.geoip object there’s property countryName from which you can fetch it add it to the user metadata → Pre User Registration Flow

I hope it will help you

Thanks
Dawid

1 Like

Hi @dawid.matuszczyk,

thanks and no problem! Yes, I saw that, but I guess there would be a problem with users that use a VPN for example. I would create a user on my end with the wrong country. Is there another way?

Thanks for your time!

Hi @dawid.matuszczyk,

have you had time to look into this?

Thanks

Hi @DenverKrueger

Sorry for the late response. If the user is actively using a VPN, you can access only the country that the user currently uses to connect to your site (via VPN). Also, if the user is using a VPN to connect to your site from another country, this wouldn’t create the wrong data entry, the data will come from the VPN connection.

Thanks
Dawid

1 Like

Hi @dawid.matuszczyk,

okay, but because of this issue, I want the user to actively select his “correct” country. So during the registration, he can select his country to not get the perhaps “wrong” country from his IP.

Thanks

Hi @DenverKrueger

So if an action is not an option, you have a few options. First, there’s no plug-and-play feature where you can add a dialog box or multi-select in nocode and add information to the user metadata.

  1. Customize New Universal Login Pages

You can customize the New Universal Login pages by providing a page template using the Liquid template language. To learn more about Liquid, read the Introduction to Liquidon Github. You can update the ULP templates only using the Management API. This capability can only be used if the tenant has Custom Domains enabled.

This way, you can extend a New Universal Login of additional fields. The page will still be hosted on Auth0, and you won’t need to take care of managing users on your side.

  1. Selfhosted Signup page
    This way, you can add as many additional fields during signups and send them to the Auth0 via ManagmentAPI Auth0 Management API v2

  2. Lock of WebLock for Web
    The last and probably the worst option is to go with Lock for Web with Text Fields or Select (Lock Configuration Options). In a text field option, the user will need to type the country or select from many, which will later be saved in the User metadata.

I think those are all the available options.
Thanks
Dawid

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

Hey team!

This topic seems related to our new EA feature, Forms for Actions, which rolled out of the beta stage on May 7th. Our Product team prepared the whole Documentation page with examples of Use cases. Forms for Actions. If you find yourself having questions regarding this new feature for the next two weeks, we are hosting an Ask Me Anything session. Our Product Expert will provide comprehensive written answers on May 21st from 8 AM to 10 AM PST.
Find out more about Forms for Actions and learn more about AMA.

Thanks!
Dawid