Skip to content

Commit 93b45d6

Browse files
committed
MQE-2082: MFTF compatibility with 2fa
1 parent 7432b52 commit 93b45d6

File tree

1 file changed

+11
-0
lines changed
  • src/Magento/FunctionalTestingFramework/DataTransport/Auth

1 file changed

+11
-0
lines changed

src/Magento/FunctionalTestingFramework/DataTransport/Auth/Tfa.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ class Tfa
2020
const ADMIN_FORM_AUTH_GOOGLE = 'tfa/google/authpost/?isAjax=true';
2121
const TFA_SCHEMA = 'schema?services=twoFactorAuthAdminTokenServiceV1';
2222

23+
/**
24+
* If 2FA is enabled
25+
*
26+
* @var boolean|null
27+
*/
28+
private static $tfaEnabled = null;
29+
2330
/** Rest request headers
2431
*
2532
* @var string[]
@@ -55,6 +62,10 @@ class Tfa
5562
*/
5663
public static function isEnabled()
5764
{
65+
if (self::$tfaEnabled !== null) {
66+
return self::$tfaEnabled;
67+
}
68+
5869
$schemaUrl = MftfGlobals::getWebApiBaseUrl() . self::TFA_SCHEMA;
5970
$transport = new CurlTransport();
6071
try {

0 commit comments

Comments
 (0)