Skip to content

Commit 03fa4a9

Browse files
authored
Merge pull request #74 from magento-performance/ims-phase1
Ims phase1
2 parents 5a561d9 + 072d1dc commit 03fa4a9

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

TwoFactorAuth/Observer/ControllerActionPredispatch.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use Magento\TwoFactorAuth\Api\UserConfigRequestManagerInterface;
2323
use Magento\TwoFactorAuth\Controller\Adminhtml\Tfa\Requestconfig;
2424
use Magento\TwoFactorAuth\Model\UserConfig\HtmlAreaTokenVerifier;
25+
use Magento\AdminAdobeIms\Service\ImsConfig;
2526

2627
/**
2728
* Handle redirection to 2FA page if required
@@ -75,6 +76,11 @@ class ControllerActionPredispatch implements ObserverInterface
7576
*/
7677
private $userContext;
7778

79+
/**
80+
* @var ImsConfig
81+
*/
82+
private ImsConfig $adminAdobeImsConfig;
83+
7884
/**
7985
* @param TfaInterface $tfa
8086
* @param TfaSessionInterface $tfaSession
@@ -84,6 +90,7 @@ class ControllerActionPredispatch implements ObserverInterface
8490
* @param UrlInterface $url
8591
* @param AuthorizationInterface $authorization
8692
* @param UserContextInterface $userContext
93+
* @param ImsConfig $adminAdobeImsConfig
8794
*/
8895
public function __construct(
8996
TfaInterface $tfa,
@@ -93,7 +100,8 @@ public function __construct(
93100
ActionFlag $actionFlag,
94101
UrlInterface $url,
95102
AuthorizationInterface $authorization,
96-
UserContextInterface $userContext
103+
UserContextInterface $userContext,
104+
ImsConfig $adminAdobeImsConfig
97105
) {
98106
$this->tfa = $tfa;
99107
$this->tfaSession = $tfaSession;
@@ -103,6 +111,7 @@ public function __construct(
103111
$this->url = $url;
104112
$this->authorization = $authorization;
105113
$this->userContext = $userContext;
114+
$this->adminAdobeImsConfig = $adminAdobeImsConfig;
106115
}
107116

108117
/**
@@ -119,9 +128,13 @@ private function redirect(string $url): void
119128

120129
/**
121130
* @inheritDoc
131+
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
122132
*/
123133
public function execute(Observer $observer)
124134
{
135+
if ($this->adminAdobeImsConfig->enabled()) {
136+
return;
137+
}
125138
/** @var $controllerAction AbstractAction */
126139
$controllerAction = $observer->getEvent()->getData('controller_action');
127140
$this->action = $controllerAction;

TwoFactorAuth/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"magento/module-ui": "*",
1313
"magento/module-user": "*",
1414
"magento/module-integration": "*",
15+
"magento/module-admin-adobe-ims": "*",
1516
"christian-riesen/base32": "^1.3",
1617
"spomky-labs/otphp": "^10.0",
1718
"endroid/qr-code": "^4.3.5",

0 commit comments

Comments
 (0)