I found this article Signup Fields on the Universal Login Page which explain how to add custom signup fields. However I’d like to know if it’s possible to send those fields in a signup request object in the authentication API. My goal is to read those custom fields from an action in the pre-user-registration flow (example below).
exports.onExecutePreUserRegistration = async (event, api) => {
let firstName = event.request.body['custom-field-first-name'].trim();
let lastName = event.request.body['custom-field-last-name'].trim();
.....
};
Thank you for posting your question; I’ve checked our documentation, and unfortunately, it’s not possible to modify the parameters during the authorized request, but you can modify them via Management API. Actions can later consume the data, as you suggested in the attached screenshot. Link to the docs about Custom Fields in Universal Login → Customize Signup and Login Prompts