diff options
author | Daniel <mail@danielkesselberg.de> | 2024-05-29 12:05:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-29 12:05:45 +0200 |
commit | fca38e12c8fd76be717ad4fe7f1d0eaecfb09288 (patch) | |
tree | 7c29aa2a92f3fd27295c284e475ddb63ec8ecd79 /lib/private | |
parent | b7b2966ce211a47edf710c3b2d0d3738e517fc81 (diff) | |
parent | bcc02a3c71b2889f1ef3acc15e09b3fda1b34fae (diff) | |
download | nextcloud-server-fca38e12c8fd76be717ad4fe7f1d0eaecfb09288.tar.gz nextcloud-server-fca38e12c8fd76be717ad4fe7f1d0eaecfb09288.zip |
Merge pull request #45411 from nextcloud/fix/auth/selective-token-activity-update
fix(auth): Update authtoken activity selectively
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Authentication/Token/PublicKeyTokenProvider.php | 2 | ||||
-rw-r--r-- | lib/private/User/Session.php | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/private/Authentication/Token/PublicKeyTokenProvider.php b/lib/private/Authentication/Token/PublicKeyTokenProvider.php index c8e00acf887..5363b82df69 100644 --- a/lib/private/Authentication/Token/PublicKeyTokenProvider.php +++ b/lib/private/Authentication/Token/PublicKeyTokenProvider.php @@ -286,8 +286,6 @@ class PublicKeyTokenProvider implements IProvider { if (!($token instanceof PublicKeyToken)) { throw new InvalidTokenException("Invalid token type"); } - $now = $this->time->getTime(); - $token->setLastActivity($now); $this->mapper->update($token); $this->cacheToken($token); } diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index 191e80dde07..9d77a90c541 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -11,6 +11,7 @@ use OC\Authentication\Exceptions\PasswordlessTokenException; 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; @@ -752,6 +753,9 @@ class Session implements IUserSession, Emitter { } $dbToken->setLastCheck($now); + if ($dbToken instanceof PublicKeyToken) { + $dbToken->setLastActivity($now); + } $this->tokenProvider->updateToken($dbToken); return true; } |