Link to reset password incorrect - http://default not resolved to URL

Created on 6 August 2022, almost 2 years ago
Updated 23 November 2023, 7 months ago

Problem/Motivation

Email sent to user contains an invalid link that does not relate to site's URL:

Your password has expired. Please visit the following link to reset your password: http://default/user/login

I cannot see any way in the Admin UI to configure this address.

The message headers show that the email message was received from the correct domain.

Steps to reproduce

  • Drupal core 9.4.3
  • Password Policy 8.x-3.1
  • Simplenews 3.0.0-beta2
  • Swift Mailer 8.x-2.2
  • Mail System 8.x-4.4
πŸ’¬ Support request
Status

Closed: works as designed

Version

4.0

Component

Documentation

Created by

πŸ‡¬πŸ‡§United Kingdom iainH

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΈπŸ‡ͺSweden edward.peters

    This issue is still unresolved. Can anyone advise me what to do?

  • Same here, on localhost working, but on staging enviroment no, I get the same http://default/...

  • Hello Guys again, I fixed this one.
    Needed to add in settings.php the domain $base_url = "https://yourdomain.com";

  • Assigned to nblack69
  • Status changed to Needs review 8 months ago
  • For me this worked on staging and prod environment.
    Hope this solve for you too, check and test it.

  • πŸ‡¬πŸ‡§United Kingdom iainH

    Do you have $settings['trusted_host_patterns'] set in settings.php? We do.
    According to this article $base_url was β€˜removed’ from settings.php for better security in favour of $settings['trusted_host_patterns'].
    There is an inconsistency that needs investigating if this is the case and the Password Policy module still needs the global variable $base_url

  • Yes, I have this too.. everything is fine.
    Only on this Password Policy module got problems with the link from mail..
    I only added the $base_url in settings.local.php which is included in settings.php and solved.
    So.. yes, maybe the module still need this global variable.

  • πŸ‡¬πŸ‡§United Kingdom somersoft

    Was the email sent as a during the running of the cron functionality?
    If so perhaps further investigation is needed there to see if drush cron is being passed the correct parameters. See https://www.drush.org/12.x/commands/core_cron/ for more information on this.

  • Status changed to Closed: works as designed 7 months ago
  • πŸ‡¦πŸ‡ΊAustralia acbramley

    Emails are sent via cron, when using drush you need to make sure drush uses your site's url with the --uri flag, or set the DRUSH_OPTIONS_URI environment variable.

Production build 0.69.0 2024