Skip to content

Commit 65c6327

Browse files
lenaorobeinaydav
authored andcommitted
magento/graphql-ce#486: Add customer account validation in Quote operations
1 parent f91224e commit 65c6327

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

app/code/Magento/QuoteGraphQl/Model/Cart/GetCartForUser.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ class GetCartForUser
3939
* @param MaskedQuoteIdToQuoteIdInterface $maskedQuoteIdToQuoteId
4040
* @param CartRepositoryInterface $cartRepository
4141
* @param StoreManagerInterface $storeManager
42+
* @param GetCustomer $getCustomer
43+
* @param ContextInterface $context
4244
*/
4345
public function __construct(
4446
MaskedQuoteIdToQuoteIdInterface $maskedQuoteIdToQuoteId,
@@ -62,6 +64,9 @@ public function __construct(
6264
*/
6365
public function execute(string $cartHash, ?int $customerId): Quote
6466
{
67+
/* verify customer is confirmed and not locked */
68+
$this->getCustomer->execute($this->context);
69+
6570
try {
6671
$cartId = $this->maskedQuoteIdToQuoteId->execute($cartHash);
6772
} catch (NoSuchEntityException $exception) {

dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetCartTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@ public function testGetCartWithNotExistingStore()
223223
}
224224

225225
/**
226-
* _security
227226
* @magentoApiDataFixture Magento/Customer/_files/customer.php
228227
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
229228
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php

0 commit comments

Comments
 (0)