0

Is there any way we get the customer password but not hashed!

I am trying this way but not getting

<?php

namespace Vendor\Customer\Observer;

use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Event\Observer;
use Psr\Log\LoggerInterface;

class LogPassword implements ObserverInterface
{
    protected $logger;

    public function __construct(
        LoggerInterface $logger
    ) {
        $this->logger = $logger;
    }

    public function execute(Observer $observer)
    {
        $customer = $observer->getEvent()->getCustomer();
        $password = $observer->getEvent()->getData('password');

        if ($password) {
            $this->logger->info('Customer password: ' . $password);
        }
    }
}

1 Answer 1

0

You can use below code to get the password.

$password = $observer->getData('account_controller')->getRequest()->getParam('password');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.