How to change forgotten password link and text in liquid page template

Hi

I’m using the Auth0 CLI to update our tenants branding using Liquid Page templates. We have a custom domain.

Using custom HTML login pages, it is easy to switch off prompts and add custom urls:

var passwordResetUrl = 'https://uk.redacted.com/web/login/updatePasswordAction.html?method=emailChangePasswordPopulate';

and then in the lock constructor

  allowForgotPassword: true,
  forgotPasswordLink: passwordResetUrl,

However using a liquid based template:

{%- auth0:widget -%}

How do turn off the forgotten password text, or set a new forgotten password link using liquid variables?

Kind Regards

Richard

Hi @richard.sanigar,

Unfortunately, the New Universal Login does not have an equivalent to the forgotPasswordLink option that Lock has. For your use case, the option we would recommend with New Universal Login would be to hide the “Forgot Password” link on the widget altogether and have your app handle password reset linking. Here is a link to another community post that covers how to hide the link: How to remove the Forgot Password link from the New Universal Login page

There is another workaround that we have seen some customers do that involves embedding client-side javascript into the template to change the link, though this is not an officially supported method and we cannot guarantee that there won’t be an unexpected breaking change at any point:

for (const link of document.querySelectorAll(“a”)) {
  if (link.textContent.includes(“Forgot password?“)) {
    // Change redirection behavior to take the user back to our app
    link.setAttribute(“href”,
      “https://domain/signin/passwd/reset?email_prefill=” + encodeURIComponent(userEmail)
    );
}

If you would like to see an out-of-the-box option to change the password reset link on the New Universal Login page, we would recommend submitting a feature request as well.

1 Like

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