customerRecoveryHashExpired example

'message' => 'No matching customer for the id "id-1" was found.',
        ];

        yield CustomerException::CUSTOMER_NOT_FOUND => [
            'exception' => CustomerException::customerNotFound('abc@com'),
            'statusCode' => Response::HTTP_NOT_FOUND,
            'errorCode' => CustomerException::CUSTOMER_NOT_FOUND,
            'message' => 'No matching customer for the email "abc@com" was found.',
        ];

        yield CustomerException::CUSTOMER_RECOVERY_HASH_EXPIRED => [
            'exception' => CustomerException::customerRecoveryHashExpired('abc@com'),
            'statusCode' => Response::HTTP_GONE,
            'errorCode' => CustomerException::CUSTOMER_RECOVERY_HASH_EXPIRED,
            'message' => 'The hash "abc@com" is expired.',
        ];

        yield CustomerException::WISHLIST_IS_NOT_ACTIVATED => [
            'exception' => CustomerException::customerWishlistNotActivated(),
            'statusCode' => Response::HTTP_FORBIDDEN,
            'errorCode' => CustomerException::WISHLIST_IS_NOT_ACTIVATED,
            'message' => 'Wishlist is not activated!',
        ];

        
throw new DecorationPatternException(self::class);
    }

    #[Route(path: '/store-api/account/recovery-password-confirm', name: 'store-api.account.recovery.password', methods: ['POST'])]     public function resetPassword(RequestDataBag $data, SalesChannelContext $context): SuccessResponse
    {
        $this->validateResetPassword($data$context);

        $hash = $data->get('hash');

        if (!$this->checkHash($hash$context->getContext())) {
            throw CustomerException::customerRecoveryHashExpired($hash);
        }

        $customerHashCriteria = new Criteria();
        $customerHashCriteria->addFilter(new EqualsFilter('hash', $hash));
        $customerHashCriteria->addAssociation('customer');

        $customerRecovery = $this->customerRecoveryRepository->search($customerHashCriteria$context->getContext())->first();

        if (!$customerRecovery instanceof CustomerRecoveryEntity) {
            throw CustomerException::customerNotFoundByHash($hash);
        }

        
Home | Imprint | This part of the site doesn't use cookies.