![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-customer-graph-ql/Model/Customer/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ declare(strict_types=1); namespace Magento\CustomerGraphQl\Model\Customer; use Magento\Customer\Model\AuthenticationInterface; use Magento\Framework\Exception\InvalidEmailOrPasswordException; use Magento\Framework\Exception\State\UserLockedException; use Magento\Framework\GraphQl\Exception\GraphQlAuthenticationException; /** * Check customer password */ class CheckCustomerPassword { /** * @var AuthenticationInterface */ private $authentication; /** * @param AuthenticationInterface $authentication */ public function __construct( AuthenticationInterface $authentication ) { $this->authentication = $authentication; } /** * Check customer password * * @param string $password * @param int $customerId * @throws GraphQlAuthenticationException */ public function execute(string $password, int $customerId) { try { $this->authentication->authenticate($customerId, $password); } catch (InvalidEmailOrPasswordException $e) { throw new GraphQlAuthenticationException(__($e->getMessage()), $e); } catch (UserLockedException $e) { throw new GraphQlAuthenticationException(__($e->getMessage()), $e); } } }