]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(auth): Update authtoken activity selectively 45348/head
authorChristoph Wurst <christoph@winzerhof-wurst.at>
Tue, 21 May 2024 05:55:01 +0000 (07:55 +0200)
committerDaniel <mail@danielkesselberg.de>
Thu, 6 Jun 2024 12:39:46 +0000 (14:39 +0200)
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
lib/private/Authentication/Token/PublicKeyTokenProvider.php
lib/private/User/Session.php

index ea1e5484dda7b33a5c4d25e5c5982e748f053638..3a15ba006d461e3c5ed8f12224ccf4663443e75a 100644 (file)
@@ -308,8 +308,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);
        }
index d718763994934b5c49dd975a5d6000b182ae558d..0360d57c0eba6083508b134089131e6216c013af 100644 (file)
@@ -43,6 +43,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;
@@ -784,6 +785,9 @@ class Session implements IUserSession, Emitter {
                }
 
                $dbToken->setLastCheck($now);
+               if ($dbToken instanceof PublicKeyToken) {
+                       $dbToken->setLastActivity($now);
+               }
                $this->tokenProvider->updateToken($dbToken);
                return true;
        }