hasLegacyPassword example



    /** * @throws CustomerNotFoundException * @throws BadCredentialsException * @throws CustomerOptinNotCompletedException */
    public function getCustomerByLogin(string $email, string $password, SalesChannelContext $context): CustomerEntity
    {
        $customer = $this->getCustomerByEmail($email$context);

        if ($customer->hasLegacyPassword()) {
            if (!$this->legacyPasswordVerifier->verify($password$customer)) {
                throw CustomerException::badCredentials();
            }

            $this->updatePasswordHash($password$customer$context->getContext());

            return $customer;
        }

        if ($customer->getPassword() === null
            || !password_verify($password$customer->getPassword())) {
            
Home | Imprint | This part of the site doesn't use cookies.