Skip to content

Commit e55ae49

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

File tree

2 files changed

+8
-35
lines changed

2 files changed

+8
-35
lines changed

app/code/Magento/Authorization/Model/CompositeUserContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ protected function add(UserContextInterface $userContext)
6060
*/
6161
public function getUserId()
6262
{
63-
return $this->getUserContext() ? $this->getUserContext()->getUserId() : null;
63+
return $this->getUserContext() ? ((int) $this->getUserContext()->getUserId()) : null;
6464
}
6565

6666
/**

app/code/Magento/Webapi/Model/Authorization/SoapUserContext.php

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -24,47 +24,32 @@ class SoapUserContext implements UserContextInterface
2424
/**
2525
* @var Request
2626
*/
27-
protected $request;
27+
private $request;
2828

2929
/**
3030
* @var Token
3131
*/
32-
protected $tokenFactory;
32+
private $tokenFactory;
3333

3434
/**
3535
* @var int
3636
*/
37-
protected $userId;
37+
private $userId;
3838

3939
/**
4040
* @var string
4141
*/
42-
protected $userType;
42+
private $userType;
4343

4444
/**
4545
* @var bool
4646
*/
47-
protected $isRequestProcessed;
47+
private $isRequestProcessed;
4848

4949
/**
5050
* @var IntegrationServiceInterface
5151
*/
52-
protected $integrationService;
53-
54-
/**
55-
* @var DateTime
56-
*/
57-
private $dateTime;
58-
59-
/**
60-
* @var Date
61-
*/
62-
private $date;
63-
64-
/**
65-
* @var OauthHelper
66-
*/
67-
private $oauthHelper;
52+
private $integrationService;
6853

6954
/**
7055
* Initialize dependencies.
@@ -79,23 +64,11 @@ class SoapUserContext implements UserContextInterface
7964
public function __construct(
8065
Request $request,
8166
TokenFactory $tokenFactory,
82-
IntegrationServiceInterface $integrationService,
83-
DateTime $dateTime = null,
84-
Date $date = null,
85-
OauthHelper $oauthHelper = null
67+
IntegrationServiceInterface $integrationService
8668
) {
8769
$this->request = $request;
8870
$this->tokenFactory = $tokenFactory;
8971
$this->integrationService = $integrationService;
90-
$this->dateTime = $dateTime ?: ObjectManager::getInstance()->get(
91-
DateTime::class
92-
);
93-
$this->date = $date ?: ObjectManager::getInstance()->get(
94-
Date::class
95-
);
96-
$this->oauthHelper = $oauthHelper ?: ObjectManager::getInstance()->get(
97-
OauthHelper::class
98-
);
9972
}
10073

10174
/**

0 commit comments

Comments
 (0)