When we register an application there’s only one URL that we can add to Login URLs. We have a usecase where we need to pass a query param like ?customer=<unique-id> to apply some UX settings.
We are currently restricting Auth0 related signup process and creting accounts on app side, then call management API to register users and then get a reset password token for the user and redirect them to that url. Given this flow after user set their password they see an option to go back to app login page where they’re currently loosing UX settings because of missing query param. Please let me know if there’s an option to preserve this value.
Hi @karuissobusy
Thank you for reaching out to us!
I understand that you are looking to preserve a custom query parameter for when your users set their Auth0 password and go back to the application login page.
Overview
Yes, you can preserve the query parameter, and the recommended approach in Auth0 is to use the Password Reset Post Challenge Action trigger combined with custom ticket parameters.
Because the Application Login URI in Application Settings is static by design, you must dynamically set the post-reset destination during the password reset transaction rather than relying on the static fallback.
Official Recommendation
If you are using New Universal Login, Auth0 provides a dedicated, synchronous Password Reset Post Challenge trigger (password-reset-post-challenge) that executes during the reset flow and allows you to dynamically set the destination URL using api.transaction.setResultUrl().
Step 1: Append the query parameter to the ticket URL
When your backend generates the password change ticket via the Management API (POST /api/v2/tickets/password-change), append customer directly as a query parameter to the ticket URL returned by Auth0:
// Backend (Node.js example)
const response = await auth0.tickets.changePassword({
user_id: user.user_id,
client_id: AUTH0_CLIENT_ID
});
// Auth0 ticket URL: https://<tenant>.auth0.com/u/reset-verify?ticket=<ticket_id>
// Append your parameter to the ticket link sent to or opened by the user:
const dynamicTicketUrl = `${response.data.ticket}&customer=${encodeURIComponent(customerId)}`;
Step 2: Dynamically set the redirect in an Action
In the Auth0 Dashboard, navigate to Actions > Triggers > Password Reset Post Challenge:
exports.onExecutePostChallenge = async (event, api) => {
// Read parameter passed on the ticket URL
const customerId = event.request.query?.customer;
if (customerId) {
api.transaction.setResultUrl(`https://myapp.example.com/login?customer=${encodeURIComponent(customerId)}`);
}
};
We hope this information helped you achieve the desired flow!
Have a great one,
Gerald