| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- namespace Magento\Customer\Observer;
- use Magento\Customer\Model\AuthenticationInterface;
- use Magento\Framework\Event\ObserverInterface;
- /**
- * Class CustomerLoginSuccessObserver
- */
- class CustomerLoginSuccessObserver implements ObserverInterface
- {
- /**
- * Authentication
- *
- * @var AuthenticationInterface
- */
- protected $authentication;
- /**
- * @param AuthenticationInterface $authentication
- */
- public function __construct(
- AuthenticationInterface $authentication
- ) {
- $this->authentication = $authentication;
- }
- /**
- * Unlock customer on success login attempt.
- * @param \Magento\Framework\Event\Observer $observer
- * @return $this
- */
- public function execute(\Magento\Framework\Event\Observer $observer)
- {
- /** @var \Magento\Customer\Model\Customer $customer */
- $customer = $observer->getEvent()->getData('model');
- $this->authentication->unlock($customer->getId());
- return $this;
- }
- }
|