"Reset Password" email dashboard url

System Information
  • Strapi Version: 4.1.12
  • Operating System: Ubuntu 20.04
  • Database: SQLite
  • Node Version: 16.15.1
  • NPM Version: 8.11.0
  • Yarn Version: 1.22.19

Hi

I have Strapi running running on a server on port 8000 and have a nginx that makes it available on https://strapi.mydomain.com.

When I click the “Forgot password” on the login page and am getting the password recovery email, the link inside is http://localhost:8000/admin/auth/reset-password?code=.... But I want the link to be https://strapi.mydomain.com/admin/auth/....

I tried setting STRAPI_URL=https://strapi.mydomain.com in the .env file but that didn’t help.

Any ideas?

3 Likes

Hi Michel,

You need to give a value to “url” global variable, in your server.js file. the value should be an environment variable, and is generally composed by “HOST” and “PORT”, or another variable containing the whole url as you can see on the screenshot.

image

This does not populate the <%= URL %> in the email template.

In Advanced settings → Reset password page

Yeah I know its there but then I have to hassle with populating it manually on dev, staging and prod. Trying to keep my config centralized.

And then every developer who clones the repo has to do this stuff too.

1 Like

I am also looking for the same to use the same instance of Strapi installation to switch these details like reset password URL and email confirmation redirection URLs for different front-end applications like dev, staging and prod based on environment variables check.