mirror of
https://github.com/friendica/friendica
synced 2025-04-27 02:30:10 +00:00
Improve 2 factor usage
This commit is contained in:
parent
f3de8d7764
commit
0223c030a9
20 changed files with 400 additions and 77 deletions
|
@ -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']
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue