Hi @kathan.shanmugapriya
- The Auth0 dashboard does not expose
custom-form as an option, so this would need to be configured entirely via Terraform/API
In order to create a custom consent screen using Forms, you can make use of the components, flows and steps available. There is an option to create a form using the Management API, however, it would require you to have a great understanding of how the form’s JSON syntax works in order to build a coherent one. Knowing this, I would highly recommend using the visualizer built within the Auth0 Dashboard.
- What is the correct way to inject a custom JS bundle inside an Auth0 Form for a
custom-form prompt?
You will be able to use the Custom Component or an HTML block in order to inject/use any kind of JS code which you want to implement inside your form.
- Since Auth0 Forms have no context, what is the recommended way to export variables like
user.email, client.name, client.logo_uri, and tenant.friendly_name through the page template so they’re accessible to the custom script?
You can access variables through some helper functions inside the forms directly:
- user.email → {{context.user.email}}
- client.name → {{context.client.name}}
- tenant.name → {{context.tenant.name}}
Things such as the logo_uri need to be set directly within the form using an Image component. Alternatively, you can set them inside the action and then access them later as such:
exports.onExecutePostLogin = async (event, api) => {
api.prompt.render(':form_id', {
vars: {
logo_uri: 'logo_uri',
}
});
}
//Later accessed as {{vars.logo_uri}}
- How do you distinguish between multiple
custom-form flows — is passing a param via the authorization URL the recommended approach?
If you need to have separate forms for separate applications, you can render the one you need using the action directly as such:
exports.onExecutePostLogin = async (event, api) => {
if (event.client.name === 'App A') {
api.prompt.render('form_id_1'); // Triggers Flow 1
} else if (event.client.name === 'App B') {
api.prompt.render('form_id_2'); // Triggers Flow 2
}
};
- What is the recommended approach for handling translations inside Auth0 Forms given that
screen.texts context is not available?
Auth0 Forms has its own dedicated localization engine. In the Auth0 Forms visual editor, there is a dedicated Translations tab.
You define your supported languages and provide the translated strings for every UI element (labels, buttons, error messages) directly within the Form configuration.
The Form automatically detects the user’s locale (passed down from the Universal Login session) and renders the correct language.
- Is
custom-form the intended prompt type for custom consent , or is customized-consent more appropriate for this use case?
The Forms feature is the intended approach for a Custom consent flow —things such as accepting a custom EULA, agreeing to complex Data Processing Agreements (DMA), marketing opt-ins, or presenting specific dynamic checkboxes.
If you have any other questions, let me know!
Kind Regards,
Nik