feat: add auth session limit param
This commit is contained in:
parent
509aef16bd
commit
fd93c8aebd
1 changed files with 7 additions and 0 deletions
|
@ -114,6 +114,12 @@ class Project extends Model
|
||||||
'default' => 0,
|
'default' => 0,
|
||||||
'example' => 100,
|
'example' => 100,
|
||||||
])
|
])
|
||||||
|
->addRule('authSessionsLimit', [
|
||||||
|
'type' => self::TYPE_INTEGER,
|
||||||
|
'description' => 'Max sessions allowed per user. 100 maximum.',
|
||||||
|
'default' => 100,
|
||||||
|
'example' => 10,
|
||||||
|
])
|
||||||
->addRule('providers', [
|
->addRule('providers', [
|
||||||
'type' => Response::MODEL_PROVIDER,
|
'type' => Response::MODEL_PROVIDER,
|
||||||
'description' => 'List of Providers.',
|
'description' => 'List of Providers.',
|
||||||
|
@ -233,6 +239,7 @@ class Project extends Model
|
||||||
|
|
||||||
$document->setAttribute('authLimit', $authValues['limit'] ?? 0);
|
$document->setAttribute('authLimit', $authValues['limit'] ?? 0);
|
||||||
$document->setAttribute('authDuration', $authValues['duration'] ?? Auth::TOKEN_EXPIRATION_LOGIN_LONG);
|
$document->setAttribute('authDuration', $authValues['duration'] ?? Auth::TOKEN_EXPIRATION_LOGIN_LONG);
|
||||||
|
$document->setAttribute('authSessionLimit', $authValues['maxSessions'] ?? APP_LIMIT_USER_SESSIONS);
|
||||||
|
|
||||||
foreach ($auth as $index => $method) {
|
foreach ($auth as $index => $method) {
|
||||||
$key = $method['key'];
|
$key = $method['key'];
|
||||||
|
|
Loading…
Reference in a new issue