fix: merge conflicts
This commit is contained in:
parent
1ab3dc2236
commit
d802e86593
1 changed files with 8 additions and 0 deletions
|
@ -1242,6 +1242,13 @@ $createSession = function (string $userId, string $secret, Request $request, Res
|
||||||
$sessionSecret = Auth::tokenGenerator(Auth::TOKEN_LENGTH_SESSION);
|
$sessionSecret = Auth::tokenGenerator(Auth::TOKEN_LENGTH_SESSION);
|
||||||
$expire = DateTime::formatTz(DateTime::addSeconds(new \DateTime(), $duration));
|
$expire = DateTime::formatTz(DateTime::addSeconds(new \DateTime(), $duration));
|
||||||
|
|
||||||
|
$factor = match($verifiedToken->getAttribute('type')) {
|
||||||
|
Auth::TOKEN_TYPE_MAGIC_URL, Auth::TOKEN_TYPE_OAUTH2 => 'email',
|
||||||
|
Auth::TOKEN_TYPE_PHONE => 'phone',
|
||||||
|
Auth::TOKEN_TYPE_GENERIC => 'token',
|
||||||
|
default => throw new Exception(Exception::USER_INVALID_TOKEN)
|
||||||
|
};
|
||||||
|
|
||||||
$session = new Document(array_merge(
|
$session = new Document(array_merge(
|
||||||
[
|
[
|
||||||
'$id' => ID::unique(),
|
'$id' => ID::unique(),
|
||||||
|
@ -1251,6 +1258,7 @@ $createSession = function (string $userId, string $secret, Request $request, Res
|
||||||
'secret' => Auth::hash($sessionSecret), // One way hash encryption to protect DB leak
|
'secret' => Auth::hash($sessionSecret), // One way hash encryption to protect DB leak
|
||||||
'userAgent' => $request->getUserAgent('UNKNOWN'),
|
'userAgent' => $request->getUserAgent('UNKNOWN'),
|
||||||
'ip' => $request->getIP(),
|
'ip' => $request->getIP(),
|
||||||
|
'factors' => [$factor],
|
||||||
'countryCode' => ($record) ? \strtolower($record['country']['iso_code']) : '--',
|
'countryCode' => ($record) ? \strtolower($record['country']['iso_code']) : '--',
|
||||||
],
|
],
|
||||||
$detector->getOS(),
|
$detector->getOS(),
|
||||||
|
|
Loading…
Reference in a new issue