Universal Login – password change for user that is logged in

Hi @martin.stepanek

Welcome to the Auth0 Community!

I understand that you would like the ability to allow logged in users to change their password while taking into account their localization.

The behaviour that you are experiencing is a known limitation in Auth0. You are not missing anything regarding the Authentication API endpoint; the /dbconnections/change_password endpoint drops custom headers like Accept-Language and x-request-language, meaning the request_language variable in Liquid templates will always be empty for this specific flow.

Recommended approaches

Approach 1. Store each user’s language_preference in their user_metadata

  1. Update user metadata with language preference whenever the user changes their language setting in your app. Call the Auth0 Management API endpoint PATCH /api/v2/users/{id} with a request body like:
{
    "user_metadata": {
    "preferred_language": "es"
    }
   }

Replace es with the appropriate language code your app uses.

  1. Edit your password-reset email template in the Auth0 Dashboard. Navigate to Branding → Email Templates → Change Password (or Password Reset, depending on your Auth0 tenant version).

  2. Reference the user metadata in the template using Liquid syntax. Instead of relying on request_language, use:

   {% if user.user_metadata.preferred_language == "es" %}
    <!-- Spanish email content -->
   {% elsif user.user_metadata.preferred_language == "fr" %}
    <!-- French email content -->
   {% else %}
    <!-- Default language content -->
   {% endif %}

Or use a simpler approach with a single template that pulls the language value and passes it to a translation service or conditional block.

  1. Call the /dbconnections/change_password endpoint from your app as you are already doing. The email will now render using the language stored in user.user_metadata.preferred_language.

Approach 2. Management API Password Change Tickets

  1. Generate a Ticket: When the user clicks “Change Password” in your app’s profile page, your backend calls the Management API endpoint: POST /api/v2/tickets/password-change.

  2. Receive the Link: Auth0 generates the token and returns a raw ticket URL (the reset link) in the API response, rather than sending an email.

  3. Send the Email: Since your backend already knows the user’s current session language, it can inject the ticket URL into a localized email template and send it directly via your own email provider (e.g., SendGrid, AWS SES).

  4. Localize the Auth0 Form (Optional): Before putting the ticket URL in the email, you can append a ui_locales parameter (e.g., &ui_locales=fr-FR) to the link.

    This ensures that when the user clicks the link, the actual Auth0 password reset web page is also displayed in their preferred language. (Note: Auth0 ticket URLs often contain a hash #, so ensure you append the query parameter correctly before the hash).

Hope this helped you clear the issue and achieve the desired flow!

Have a great one,
Gerald