Skip to content

Commit c14a78f

Browse files
author
okarpenko
committed
MAGETWO-37815: Unable to revoke All Access Tokens for Customer without Tokens
1 parent 7ad03d2 commit c14a78f

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

app/code/Magento/Customer/Controller/Adminhtml/Customer/InvalidateToken.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,11 @@
77

88
namespace Magento\Customer\Controller\Adminhtml\Customer;
99

10-
use Magento\Integration\Api\CustomerTokenServiceInterface;
11-
1210
/**
1311
* Class to invalidate tokens for customers
1412
*/
1513
class InvalidateToken extends \Magento\Customer\Controller\Adminhtml\Index
1614
{
17-
/**
18-
* @var CustomerTokenServiceInterface
19-
*/
20-
protected $tokenService;
21-
22-
/**
23-
* Inject dependencies.
24-
*
25-
* @param CustomerTokenServiceInterface $tokenService
26-
*/
27-
public function __construct(CustomerTokenServiceInterface $tokenService)
28-
{
29-
$this->tokenService = $tokenService;
30-
}
31-
3215
/**
3316
* Reset customer's tokens handler
3417
*

app/code/Magento/Customer/Controller/Adminhtml/Index.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Magento\Framework\Message\Error;
1616
use Magento\Framework\ObjectFactory;
1717
use Magento\Framework\Api\DataObjectHelper;
18+
use Magento\Integration\Api\CustomerTokenServiceInterface;
1819

1920
/**
2021
* Class Index
@@ -143,6 +144,11 @@ class Index extends \Magento\Backend\App\Action
143144
*/
144145
protected $resultJsonFactory;
145146

147+
/**
148+
* @var CustomerTokenServiceInterface
149+
*/
150+
protected $tokenService;
151+
146152
/**
147153
* @param \Magento\Backend\App\Action\Context $context
148154
* @param \Magento\Framework\Registry $coreRegistry
@@ -197,7 +203,8 @@ public function __construct(
197203
\Magento\Framework\View\Result\LayoutFactory $resultLayoutFactory,
198204
\Magento\Framework\View\Result\PageFactory $resultPageFactory,
199205
\Magento\Backend\Model\View\Result\ForwardFactory $resultForwardFactory,
200-
\Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory
206+
\Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory,
207+
CustomerTokenServiceInterface $tokenService
201208
) {
202209
$this->_coreRegistry = $coreRegistry;
203210
$this->_fileFactory = $fileFactory;
@@ -223,6 +230,7 @@ public function __construct(
223230
$this->resultPageFactory = $resultPageFactory;
224231
$this->resultForwardFactory = $resultForwardFactory;
225232
$this->resultJsonFactory = $resultJsonFactory;
233+
$this->tokenService = $tokenService;
226234
parent::__construct($context);
227235
}
228236

0 commit comments

Comments
 (0)