/** * @return void */ public function executeInternal() { if ($userId = $this->getRequest()->getParam('user_id')) { try { $this->tokenService->revokeAdminAccessToken($userId); $this->messageManager->addSuccess(__('You have revoked the user\'s tokens.')); $this->_redirect('adminhtml/*/edit', ['user_id' => $userId]); return; } catch (\Exception $e) { $this->messageManager->addError($e->getMessage()); $this->_redirect('adminhtml/*/edit', ['user_id' => $userId]); return; } } $this->messageManager->addError(__('We can\'t find a user to revoke.')); $this->_redirect('adminhtml/*'); }
/** * @expectedException \Magento\Framework\Exception\AuthenticationException * @expectedExceptionMessage You did not sign in correctly or your account is temporarily disabled. */ public function testCreateAdminAccessTokenInvalidCustomer() { $adminUserName = '******'; $password = '******'; $this->tokenService->createAdminAccessToken($adminUserName, $password); }