DB의 고객 비밀번호 해시입니다. 따라서 MD5 & Sha1이 작동하지 않습니다.
UPDATE `customer_entity` SET `password` = MD5('test123') WHERE `email` = 'X@X.com';
데이터베이스 쿼리를 사용하여 비밀번호를 업데이트하는 방법 아마도MD5(Sha1('test123'))
?
Magento가 코드를 통해 수행하는 방식 이동vendor\magento\module-customer\Console\Command\UpgradeHashAlgorithmCommand.php
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->collection = $this->customerCollectionFactory->create();
$this->collection->addAttributeToSelect('*');
$customerCollection = $this->collection->getItems();
/** @var $customer Customer */
foreach ($customerCollection as $customer) {
$customer->load($customer->getId());
if (!$this->encryptor->validateHashVersion($customer->getPasswordHash())) {
list($hash, $salt, $version) = explode(Encryptor::DELIMITER, $customer->getPasswordHash(), 3);
$version .= Encryptor::DELIMITER . Encryptor::HASH_VERSION_LATEST;
$customer->setPasswordHash($this->encryptor->getHash($hash, $salt, $version));
$customer->save();
$output->write(".");
}
}
$output->writeln(".");
$output->writeln("<info>Finished</info>");
}