Hi,
using Password Reset / Post Challenge action, there is an option to render custom prompt as per this documentation.
api.prompt.render(promptId, promptOptions)
But I’m unable to find how to use this.
If I use this with any value in the promptId field, it always takes the request to reset-password-error screen and when I checked the hooks, I cant find any useful information there.
I tried passing vars, fields, simple objects but no luck.
Is there any proper way to render an existing or custom (how to configure) prompt screen with this object.
Examples I tried:
api.prompt.render(“reset-password-error”,{
vars: {
reason: "already-initiated",
identifier: "pwd-recent-initiation",
},
fields: {
reason: "already-initiated",
identifier: "pwd-recent-initiation",
},
reason: “already-initiated”,
identifier: "pwd-recent-initiation",
})
Hi @Jojo.Jose
You are trying to use the api.prompt.render(promptId, promptOptions) method in a Password Reset / Post-Challenge action to render a custom prompt screen with specific variables and fields. However, when you call this method with any promptId value, the request always redirects to the reset-password-error screen, and you cannot find useful information in the logs about what is happening. You have tried passing various structures in the promptOptions parameter (including vars, fields, and direct properties), but none of them work as expected.
The api.prompt.render() method is designed to render custom forms (created via Auth0 Forms) in Post-Login actions, not in Password Reset / Post-Challenge actions. The method may not be supported in the Password Reset / Post-Challenge trigger, which is why it is always redirecting to the error screen. Additionally, reset-password-error is not a valid prompt ID for api.prompt.render().
In order to render a prompt, you need to:
- Go to the Auth0 Dashboard
- Select Actions → Forms → Create Form
- Use the generated prompt ID under the Render tab
I understand that the API object documentation for the password-reset-post-challenge Actions trigger includes the api.prompt.render() method, I will be reaching out internally to investigate this matter.
I would highly recommend reviewing our documentation on Forms and how to render a form using Actions.
Kind Regards,
Nik