Skip to content

Logging in on frontend of Magento 2.3.2 doesn't seem to work properly after you ran 'bin/magento customer:hash:upgrade' #23517

@hostep

Description

@hostep

Preconditions (*)

  1. PHP 7.2.19 where you have the sodium extension installed, and have libsodium >= 1.0.13 (this is very important!)

Steps to reproduce (*)

  1. Have Magento 2.3.1 installed
  2. Create 2 customers in the frontend, remember their passwords
  3. Look into the database to the password_hash column in the customer_entity table, they look something like this: {64-random-chars}:{32-random-chars}:1 Screen1
  4. Upgrade to Magento 2.3.2
  5. Login with the first customer in the frontend
  6. Look at the database again, his password_hash has changed to: {64-random-chars}:{16-random-chars}:2 Screen2
  7. Logout and log back in with the first customer, notice that this works => good
  8. Now, assume you can't wait on every customer to login to upgrade their password hash and just do it yourself by running bin/magento customer:hash:upgrade
  9. Look at the database again, the password_hash for the second customer has changed to: {64-random-chars}:{32-random-chars}:1:2 Screen3
  10. Now try to login with the second customer on the frontend, this does not work => not good

Expected result (*)

  1. It is expected to be able to login with a customer after you ran bin/magento customer:hash:upgrade

Actual result (*)

  1. You can't login with a customer after you ran bin/magento customer:hash:upgrade

Discussion

I assume executing bin/magento customer:hash:upgrade upgrades the password_hash to the new algorithm, but not by using the unhashed password, because it can't know it. Then on the next login of that particular customer, it should detect this because the hash ends with :1:2 and then again re-hash it and change it to just :2.
But that doesn't seem to be working here for some reason.
Watch out: I have no idea if this is actually how Magento wanted to implement this, but this makes sense. Unfortunately there seems to be something broken in the implementation.

Metadata

Metadata

Labels

Component: CustomerComponent: Framework/DBUSE ONLY for FRAMEWORK RELATED BUG!Fixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions