Skip to content

Commit 5d0800d

Browse files
authored
Merge pull request #232 from magento-borg/tfa-static-fix-1.0.0
2fa static fix
2 parents f3b966e + b51a20e commit 5d0800d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

TwoFactorAuth/Model/AdminAccessTokenService.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,16 @@ public function createAdminAccessToken($username, $password): string
9090
}
9191

9292
if (!$this->configRequestManager->isConfigurationRequiredFor($userId)) {
93-
// @codingStandardsIgnoreStart
9493
throw new LocalizedException(
95-
__(
94+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
95+
call_user_func(
96+
'__',
9697
'Please use the 2fa provider-specific endpoints to obtain a token.',
9798
[
9899
'active_providers' => $activeProviderCodes
99100
]
100101
)
101102
);
102-
// @codingStandardsIgnoreEnd
103103
} elseif (empty($this->tfa->getUserProviders($userId))) {
104104
// It is expected that available 2fa providers are selected via db or admin ui
105105
throw new LocalizedException(
@@ -116,7 +116,9 @@ public function createAdminAccessToken($username, $password): string
116116
}
117117

118118
throw new LocalizedException(
119-
__(
119+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
120+
call_user_func(
121+
'__',
120122
'You are required to configure personal Two-Factor Authorization in order to login. '
121123
. 'Please check your email.',
122124
[

0 commit comments

Comments
 (0)