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

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