From fd93c8aebd8cc228322d0000e6ff0d0717dfc39d Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 11 Dec 2022 07:15:18 +0000 Subject: [PATCH] feat: add auth session limit param --- src/Appwrite/Utopia/Response/Model/Project.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Appwrite/Utopia/Response/Model/Project.php b/src/Appwrite/Utopia/Response/Model/Project.php index 42f360d6ab..dab80af3c2 100644 --- a/src/Appwrite/Utopia/Response/Model/Project.php +++ b/src/Appwrite/Utopia/Response/Model/Project.php @@ -114,6 +114,12 @@ class Project extends Model 'default' => 0, 'example' => 100, ]) + ->addRule('authSessionsLimit', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Max sessions allowed per user. 100 maximum.', + 'default' => 100, + 'example' => 10, + ]) ->addRule('providers', [ 'type' => Response::MODEL_PROVIDER, 'description' => 'List of Providers.', @@ -233,6 +239,7 @@ class Project extends Model $document->setAttribute('authLimit', $authValues['limit'] ?? 0); $document->setAttribute('authDuration', $authValues['duration'] ?? Auth::TOKEN_EXPIRATION_LOGIN_LONG); + $document->setAttribute('authSessionLimit', $authValues['maxSessions'] ?? APP_LIMIT_USER_SESSIONS); foreach ($auth as $index => $method) { $key = $method['key'];