Hi everyone,
I’m currently working on the New Universal Login experience for my platform, AIELTS, and I’m looking for some architectural guidance.
I want to capture extra profile fields (like “Full Name” or “Company Name”) during the signup process. Previously, I was looking into adding these directly to the signup widget, but I’ve realized that the current New Universal Login dashboard doesn’t provide a simple “Add Field” button for database connections like the legacy classic widget did.
Kindly, let me know the ways of adding it without adding custom domains / creating personalized forms.
Hi @ayanpaul.dev
Welcome to the Auth0 Community!
I understand you are looking for a solution of capturing extra fields form your users ( such as Full Name or Company Name) during the signup process, without the use of features requiring a custom domain.
The most suitable feature that can allow this flow would be Forms for Actions, more specifically I recommend our documentation on goes over the Use Cases: Configure a progressive profile form using Forms. This allows you to setup prompts during the signup process for your users where they are asked to provide additional details ( such as Full Name or Company Name ) which are collected and stored as user_metadata attributes through a Post-Login Action
This approach fits your use-case as the Form runs hosted on Auth0’s default domain, it does not require a custom domain and is managed fully within the Auth0 Dashboard UI without custom HTML/CSS page templates.
While the above documentation does a great job at outlining the steps that need to be taken to achieve this, allow me to shortly explain the general flow:
-
Create the Form:
- Go to Auth0 Dashboard > Actions > Forms;
- Select Create Form > Start from scratch (or use the Progressive Profiling template);
- Drag in text input fields for Full Name and Company Name.
-
Configure the Post-Login Action:
- Go to Actions > Flows > Login and select Build from scratch to create a custom Action;
- Implement logic in the Action code to check if the user is logging in for the first time or is missing these fields in their metadata. If missing, invoke the form:
/**
* @param {Event} event - Details about the user and the context in which they are logging in.
* @param {PostLoginAPI} api - Interface whose methods can be used to change the behavior of the login.
*/
exports.onExecutePostLogin = async (event, api) => {
const FORM_ID = 'REPLACE_WITH_YOUR_FORM_ID';
if (
event.stats.logins_count > 2 &&
!event.user.user_metadata.company_name &&
!event.user.user_metadata.full_name
) {
api.prompt.render(FORM_ID);
}
}
exports.onContinuePostLogin = async (event, api) => { }
Hope this helped, please reach out to us for any other issues or requests and we will gladly look into it for you!
Have a great one,
Gerald