I am wondering how to set the user metadata for user registration via social connections. When logging in with credentials, this works without any problems out of the box. We can simply add the user metadata as follows.
We have different roles and different custom universal login pages where users can register. We want to define the role depending on where the user sign up.
This is a standard use case. How do you solve this with Auth0? I have searched the whole internet and have not found anything.
You can set a Social User’s metadata when they first sign up by using a Post-Login Action script.
Whenever a user signs up, they automatically log in as well. Because of this, you can check if the user’s login_count equals 1 and if the connection is social, then set the user_metadata on the user’s first login.
Unfortunately, this does not solve the problem. Imagine I have roleA and roleB and two different signup pages. A signup page for roleA and a separate signup page for roleB. I implemented this using a custom universal login.
This is more convenient for my users and will result in a higher conversion rate compared to offer a selection of the role after the signup.
I would like to write information in the user metadata, so that I can set the role in an action script afterwards.
If I implement your solution, then all users get the same role.
oh that’s bad news. There is a big difference between the roles. It is a platform where Twitch streamers and their community users can interact with each other. I only provide sign in using Twitch social.
I would like to create two different sign in pages, so that I can better promote the value for the individual role.
I don’t want to show the community users the ability to assign the role of a streamer after they sign up.
The onboarding of a streamer is different from that of a community user. Additional data is required, and a streamer is only accepted after a manual check.
If I cannot pass user_metadata, how can I implement something like an invitation link? When a user signs in, I want to save if he was invited by another user. This could also be implemented using user_metadata.
It feels like inconvenient if this entire flow starts after the user signs in. There are many other two-sided platforms that also set the role assignment the way I prefer.