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

@ -27,7 +27,7 @@ use Friendica\Util\Strings;
class TrustedBrowser extends BaseFactory
{
public function createForUserWithUserAgent($uid, $userAgent): \Friendica\Security\TwoFactor\Model\TrustedBrowser
public function createForUserWithUserAgent(int $uid, string $userAgent, bool $trusted): \Friendica\Security\TwoFactor\Model\TrustedBrowser
{
$trustedHash = Strings::getRandomHex();
@ -35,6 +35,7 @@ class TrustedBrowser extends BaseFactory
$trustedHash,
$uid,
$userAgent,
$trusted,
DateTimeFormat::utcNow()
);
}
@ -45,6 +46,7 @@ class TrustedBrowser extends BaseFactory
$row['cookie_hash'],
$row['uid'],
$row['user_agent'],
$row['trusted'],
$row['created'],
$row['last_used']
);