diff --git a/config/config.sample.php b/config/config.sample.php index f45e7dcc5e0f6..56849e4711526 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -370,7 +370,7 @@ * Tokens are still checked every 5 minutes for validity * max value: 300 * - * Defaults to ``300`` + * Defaults to ``60`` */ 'token_auth_activity_update' => 60, diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index d718763994934..0360d57c0eba6 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -43,6 +43,7 @@ use OC\Authentication\Exceptions\PasswordLoginForbiddenException; use OC\Authentication\Token\IProvider; use OC\Authentication\Token\IToken; +use OC\Authentication\Token\PublicKeyToken; use OC\Authentication\TwoFactorAuth\Manager as TwoFactorAuthManager; use OC\Hooks\Emitter; use OC\Hooks\PublicEmitter; @@ -784,6 +785,9 @@ private function checkTokenCredentials(IToken $dbToken, $token) { } $dbToken->setLastCheck($now); + if ($dbToken instanceof PublicKeyToken) { + $dbToken->setLastActivity($now); + } $this->tokenProvider->updateToken($dbToken); return true; }