1
0
Fork 0
mirror of synced 2024-07-03 21:50:34 +12:00

Update Factors Session Migration

This commit is contained in:
Bradley Schofield 2024-02-21 09:31:52 +00:00
parent a5d6af9ded
commit 370e814b8c

View file

@ -540,7 +540,14 @@ class V20 extends Migration
$duration = $this->project->getAttribute('auths', [])['duration'] ?? Auth::TOKEN_EXPIRATION_LOGIN_LONG;
$expire = DateTime::addSeconds(new \DateTime(), $duration);
$document->setAttribute('expire', $expire);
$document->setAttribute('factors', ['email']);
$factors = match ($document->getAttribute('provider')) {
Auth::SESSION_PROVIDER_ANONYMOUS => ['anonymous'],
Auth::SESSION_PROVIDER_PHONE => ['phone'],
default => ['email'],
};
$document->setAttribute('factors', $factors);
break;
}
return $document;