Skip to content

Login with existing account throws error if password hash is empty #1067

@rafczow

Description

@rafczow

What I expected

Trying to login to account without a password, a default message about incorrect password should appear.
User can use Reset password feature to set a new password.

What happened instead

User gets blank page with error:
image

Steps to reproduce the issue

  1. Create user at admin area (without password) or with other 3rd party service. password_hash field of customer_entity will be NULL.
  2. Try to login at frontend using Login with Amazon Pay
  3. From amazon login page user is redirected to store page with message informing that store account already exists for given email with form requesting password.
  4. Type in anything in password field and submit form.

Expected result (*)
Redirect back to form with message 'The password supplied was incorrect'

Actual result (*)
User cannot login and gets blank page.
PHP Fatal error: Uncaught TypeError: explode() expects parameter 2 to be string, null given in /vendor/magento/framework/Encryption/Encryptor.php:323

Your setup

  • Magento version: 2.4.1
  • Amazon Pay Extension Version: 5.2.0
  • Magento Edition: Community

Additional comment

Same issue was found in core magento module and is described in this issue:
magento/magento2#19060
and solved here:
https://github.com/magento/magento2/pull/19066/files

In my store i've also changed a message from:
"The password supplied was incorrect."
to:
"The password supplied was incorrect. To reset your password please click on Forgot your password."

To give user a hint on solution if he never set a password for his account but doesnt know about it. Im not sure if it should be included in a fix thought.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions