Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions TwoFactorAuth/Model/AdminAccessTokenService.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,16 @@ public function createAdminAccessToken($username, $password): string
}

if (!$this->configRequestManager->isConfigurationRequiredFor($userId)) {
// @codingStandardsIgnoreStart
throw new LocalizedException(
__(
// phpcs:ignore Magento2.Functions.DiscouragedFunction
call_user_func(
'__',
'Please use the 2fa provider-specific endpoints to obtain a token.',
[
'active_providers' => $activeProviderCodes
]
)
);
// @codingStandardsIgnoreEnd
} elseif (empty($this->tfa->getUserProviders($userId))) {
// It is expected that available 2fa providers are selected via db or admin ui
throw new LocalizedException(
Expand All @@ -116,7 +116,9 @@ public function createAdminAccessToken($username, $password): string
}

throw new LocalizedException(
__(
// phpcs:ignore Magento2.Functions.DiscouragedFunction
call_user_func(
'__',
'You are required to configure personal Two-Factor Authorization in order to login. '
. 'Please check your email.',
[
Expand Down