Improve 2 factor usage

This commit is contained in:
Philipp 2022-06-25 14:45:33 +02:00
parent f3de8d7764
commit 0223c030a9
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
20 changed files with 400 additions and 77 deletions

View file

@ -24,6 +24,7 @@ namespace Friendica\Module\Settings\TwoFactor;
use Friendica\Core\Renderer;
use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Network\HTTPException\FoundException;
use Friendica\Security\TwoFactor\Model\AppSpecificPassword;
use Friendica\Security\TwoFactor\Model\RecoveryCode;
use Friendica\Model\User;
@ -90,7 +91,9 @@ class Index extends BaseSettings
break;
}
} catch (\Exception $e) {
notice(DI::l10n()->t('Wrong Password'));
if (!($e instanceof FoundException)) {
notice(DI::l10n()->t($e->getMessage()));
}
}
}

View file

@ -121,6 +121,7 @@ class Trusted extends BaseSettings
'os' => $result->os->family,
'device' => $result->device->family,
'browser' => $result->ua->family,
'trusted_labeled' => $trustedBrowser->trusted ? $this->t('Yes') : $this->t('No'),
];
return $trustedBrowser->toArray() + $dates + $uaData;
@ -135,7 +136,8 @@ class Trusted extends BaseSettings
'$device_label' => $this->t('Device'),
'$os_label' => $this->t('OS'),
'$browser_label' => $this->t('Browser'),
'$created_label' => $this->t('Trusted'),
'$trusted_label' => $this->t('Trusted'),
'$created_label' => $this->t('Created At'),
'$last_used_label' => $this->t('Last Use'),
'$remove_label' => $this->t('Remove'),
'$remove_all_label' => $this->t('Remove All'),