Reset password shares email for both the users sharing same email.

Created on 5 January 2025, about 1 month ago

Problem/Motivation

When a user submits the password reset form. receives two emails with links to reset the password for both accounts which use the same email address.

Steps to reproduce

in config select both email and username

Proposed resolution

Only the user who matches the email and username should receive the email.

🐛 Bug report
Status

Active

Component

Code

Created by

🇮🇳India pratiks

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

Comments & Activities

  • Issue created by @pratiks
  • 🇮🇳India vinayakmk47

    I have thoroughly tested the described issue and found that the functionality is working as expected. Here are the details:

    Steps Taken:

    Configured the site to allow both email and username as login identifiers.
    Created two users with the following details:
    User A: Username user_a, Email test@example.com.
    User B: Username user_b, Email test@example.com.
    Submitted the password reset form with the email test@example.com and username.
    Observed the email-sending process in both the logs and at the code level.
    Verified at the code level that the system correctly matches the email and username and sends the reset link to the appropriate account.
    only single account not multiple with same mail addresses
    Environment Details:

    Drupal Version: 9.5.11
    PHP Version: 8.1.25
    Mail Handling: Using DDEV's Mailpit for local testing.
    Debugging Tools: Used var_dump to check the user account being processed during the password reset. (See attached screenshot for verification.)
    Results:

    Only one email is sent to the user matching the provided email and username.
    No duplicate emails are sent.
    Suggestions for Further Investigation:

    Verify if any custom modules, hooks, or workflows are interfering with the password reset process.
    Confirm the settings in /admin/config/people/accounts for account login options.
    Test the issue on a clean Drupal installation to rule out configuration or module conflicts.

  • 🇮🇳India pratiks

    When I did a vardump after the form submission it shows me only one user, but in my mailbox I'm receiving two emails.

Production build 0.71.5 2024