Universal Login – password change for user that is logged in

Hi!

We are using Universal Login for our app. For login, we have a link in the app that redirects user to the Auth0 login form – user fills that and gets redirected back into our app, all good.

If the user forgot the password, there is a button in that login form that leads to password reset Auth0 page/form. Filling that will send user an email with a link to set new password. Still good.

The use-case I want to cover now is that when the user does log into the app, in the profile page I want to have a button for “password change”.

First thing I tried was looking for a way to send the user directly to that password reset Auth0 form/page. I found this source: Change Users' Passwords - Auth0 Docs, and from that I understood that there is no way to do this – the recommended way is to direct the user to the login page instead, and they have to find and click the reset password button themselves. This is not the UX I want to offer though – users might get confused or miss the button.

Another way I found (from the same source) was using Authentication API, calling /dbconnections/change_password. I tried that and it worked – it sends the same email with a link to reset the password. There is one issue though: localisation.

Users may select language in our app, and to provide good UX I wanted to send a reset email in that same language. I tried providing Accept-Language and x-request-language headers (found those in the docs for some other feature) but with no luck – request_language variable in Liquid in the email template, that works fine for the first way above, never populated in this case (always empty array).

I found some related questions (e.g. Set UI locale when triggering change password email flow ) but no easy answers. I was left with these options:

  • force user to go through login form and find reset button there
  • send emails in other language than the user has in the app (use one language for all)
  • manage syncing something like user.user_metadata.lang and update that whenever user language changes (complex, single truth in multiple places)

Is there something I am missing or is there really no other way?

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