You Want :
- Successful login or option to create a password for first time user
But Actually Does
- A user cannot log in and gets a blank page.
- Server logs show error and PLAIN USER PASSWORD that he tried to use (very wrong idea).
Error :
PHP Fatal error: Uncaught TypeError: explode() expects parameter 2 to be string, null given in /vendor/magento/framework/Encryption/Encryptor.php:236
Stack trace:
#0 /vendor/magento/framework/Encryption/Encryptor.php(236): explode(‘:’, NULL, 3)
#1 /vendor/magento/framework/Encryption/Encryptor.php(205): Magento\Framework\Encryption\Encryptor->explodePasswordHash(NULL)
#2 /vendor/magento/framework/Encryption/Encryptor.php(197): Magento\Framework\Encryption\Encryptor->isValidHash(‘PLAIN PASSWORD HERE’, NULL)
#3 /vendor/magento/module-customer/Model/Authentication.php(170): Magento\Framework\Encryption\Encryptor->validateHash(‘PLAIN PASSWORD HERE’, NULL)
How to Solve :
Go to In Magento root Directory then vendor/magento/module_customer/Model/Authentication.php
Original Code :
Line 170
$hash = $customerSecure->getPasswordHash(); if (!$this->encryptor->validateHash($password, $hash)) {
Corrected Code :
Line 170
$hash = $customerSecure->getPasswordHash(); if (!$hash || !$this->encryptor->validateHash($password, $hash)) {
Replace New Code with old one, then Refresh cache.
Enjoy Your Development.
Pratik Panchal.