Skip to content

Commit f65b6b5

Browse files
committed
160 Change resolver to be similar to ChangePassword
1 parent 342c052 commit f65b6b5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/code/Magento/CustomerGraphQl/Model/Resolver/Customer/Account/RevokeCustomerToken.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,17 @@ public function resolve(
6161
array $value = null,
6262
array $args = null
6363
): Value {
64-
if ((!$context->getUserId()) || $context->getUserType() == UserContextInterface::USER_TYPE_GUEST) {
64+
65+
$customerId = (int) $this->userContext->getUserId();
66+
67+
if ($customerId === 0) {
6568
throw new GraphQlAuthorizationException(
6669
__(
6770
'Current customer does not have access to the resource "%1"',
6871
[\Magento\Customer\Model\Customer::ENTITY]
6972
)
7073
);
7174
}
72-
$customerId = $context->getUserId();
7375

7476
$result = function () use ($customerId) {
7577
return $this->customerTokenService->revokeCustomerAccessToken($customerId);

0 commit comments

Comments
 (0)