diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2020-10-08 11:52:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-08 11:52:45 +0200 |
commit | 84a58957d558fbacb348af6910db263b05370ee2 (patch) | |
tree | 052ab19186a07ed8f24f8f057f39e1212f357f21 /lib/private | |
parent | 759f47cba364566ebbf77ca3c662a253232f9d7d (diff) | |
parent | 93756602541232a6154d9a96c725180d173672eb (diff) | |
download | nextcloud-server-84a58957d558fbacb348af6910db263b05370ee2.tar.gz nextcloud-server-84a58957d558fbacb348af6910db263b05370ee2.zip |
Merge pull request #23214 from nextcloud/backport/22937/stable19
[stable19] Allow configuring the activity update interval of token
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Authentication/Token/PublicKeyTokenProvider.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/Authentication/Token/PublicKeyTokenProvider.php b/lib/private/Authentication/Token/PublicKeyTokenProvider.php index 17d6a351c8e..43d708c268a 100644 --- a/lib/private/Authentication/Token/PublicKeyTokenProvider.php +++ b/lib/private/Authentication/Token/PublicKeyTokenProvider.php @@ -214,9 +214,13 @@ class PublicKeyTokenProvider implements IProvider { if (!($token instanceof PublicKeyToken)) { throw new InvalidTokenException(); } + + $activityInterval = $this->config->getSystemValueInt('token_auth_activity_update', 60); + $activityInterval = min(max($activityInterval, 0), 300); + /** @var DefaultToken $token */ $now = $this->time->getTime(); - if ($token->getLastActivity() < ($now - 60)) { + if ($token->getLastActivity() < ($now - $activityInterval)) { // Update token only once per minute $token->setLastActivity($now); $this->mapper->update($token); |