Skip to content

Commit c7d721b

Browse files
author
ogorkun
committed
MC-32830: Do not store admin and customer tokens in DB
1 parent e55ae49 commit c7d721b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

app/code/Magento/Customer/Block/Adminhtml/Form/Element/Newsletter/Subscriptions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ private function getSessionFormValue(string $name, int $arrayKey): ?string
152152
$data = $this->dataPersistor->get('customer_form');
153153
$currentCustomerId = $this->getData('customer_id');
154154
$sessionCustomerId = $data['customer']['entity_id'] ?? null;
155-
if ($sessionCustomerId === null || $currentCustomerId !== (int)$sessionCustomerId) {
155+
if ($sessionCustomerId === null || ((int) $currentCustomerId) !== (int)$sessionCustomerId) {
156156
return null;
157157
}
158158

app/code/Magento/Quote/Model/GuestCartManagement/Plugin/Authorization.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function beforeAssignCustomer(
3939
$customerId,
4040
$storeId
4141
) {
42-
if ($customerId !== (int)$this->userContext->getUserId()) {
42+
if (((int) $customerId) !== (int)$this->userContext->getUserId()) {
4343
throw new StateException(
4444
__("You don't have the correct permissions to assign the customer to the cart.")
4545
);

app/code/Magento/Quote/Model/QuoteRepository/Plugin/Authorization.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function afterGetActiveForCustomer(
7272
protected function isAllowed(\Magento\Quote\Model\Quote $quote)
7373
{
7474
return $this->userContext->getUserType() == UserContextInterface::USER_TYPE_CUSTOMER
75-
? $quote->getCustomerId() === null || $quote->getCustomerId() == $this->userContext->getUserId()
75+
? $quote->getCustomerId() === null || ((int) $quote->getCustomerId()) == $this->userContext->getUserId()
7676
: true;
7777
}
7878
}

0 commit comments

Comments
 (0)