Skip to content

[5.x]: Update error messages for users/send-password-reset-email when useEmailAsUsername is enabled #15425

@romainpoirier

Description

@romainpoirier

What happened?

Description

In Craft CMS 5, the users/send-password-reset-email action returns the following error messages:

  • Craft::t('app', 'Username or email is required.')
  • Craft::t('app', 'Invalid username or email.')

However, when the useEmailAsUsername configuration is enabled, referencing the username in the front-end is no longer relevant.

Can the messages be adapted to the following when useEmailAsUsername is true?

  • Craft::t('app', 'Email is required.')
  • Craft::t('app', 'Invalid email.')

Steps to reproduce

  1. Enable the useEmailAsUsername configuration.
  2. Attempt to use the users/send-password-reset-email action.

Expected behavior

The error messages should only reference the email when useEmailAsUsername is true.

Actual behavior

The error messages reference both the username and email, which is not relevant when useEmailAsUsername is true.

Craft CMS version

5.2.8

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions