Redirect back URL after reseting password

HI everyone,

So, I’m trying to put a button bellow the reset password form where the user can click to go back to the app login page. I checked the available variables and tried to research how to send parameters to that page but none of it worked.

Does anyone has an idea on how to implement that?

Thanks

Hi @rafaelmarques,

Welcome to the Auth0 Community!

You can set a Redirect To URL in your Change Password email template to redirect users to that URL after they have finished resetting their password.

(Reference: Customize Email Templates)

Please let me know if you have any additional questions.

Thanks,
Rueben

Hi @rueben.tiow ,

I forgot to mention.This redirect url should be dynamic based on the page where the user send the request to reset password via api in my app.

1 Like

Hi @rafaelmarques,

Thank you for your reply.

You can set up different Redirect To URLs based on your application name. For example:

{% if application.name == 'JWT.io' %} https://jwt.io {% else %} https://auth0.com {% endif %}

For more details, I recommend reading the Configuring Template fields - ( 4 ) Redirect to URL documentation on dynamic redirect to URLs.

May I help you with anything else?

Thanks,
Rueben

Hi @rueben.tiow

I tried this way but I am not actually able to know who is going to reset password.
I’d need a way to inform this paramter on the dbconnections/change_password POST request endpoint.

Hi @rafaelmarques,

There is an option to use the user object to determine who is performing a password reset.

The user object has access to the following properties:

  • user.email
  • user.email_verified
  • user.picture
  • user.nickname
  • user.given_name
  • user.family_name
  • user.name

Does that help?

If not, could you please explain the current and expected behavior of your Password Reset page?

Thanks,
Rueben

Hi @rueben.tiow

Almost. In the app, a user can manage multiple tenants (tenant1.domain.com, tenant2.domain.com …)

When a user changes password (which is the same regardless the tenant) I need to know which tenant login page the user was when requesting to reset password so I can redirect the user back to the same tenant login page.

1 Like

Hi @rafaelmarques,

Thank you for your reply.

To handle these redirects to the login page based on the applications I recommend setting the callback URL of your applications to point to your login page, and then in the Change Password Redirect To field you can pass the application.callback_domain variable, which will call the first URL listed in your application’s Allowed Callback URL.

So for example:

  • When a user changes their password on App 1 they will redirect to App 1’s login page.
  • When a user changes their password on App 2 they will redirect to App 2’s login page.

And the user’s changed passwords are synced between the applications.

See below:

Thanks,
Rueben

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.