diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2024-05-21 07:55:01 +0200 |
---|---|---|
committer | Daniel <mail@danielkesselberg.de> | 2024-06-06 14:39:46 +0200 |
commit | ce339b327f40896a00683618b4155c6223f348c4 (patch) | |
tree | 5b3d1e19e4b2046a8bd1beaf4c0a46a478bb5bb8 /lib | |
parent | c647f892961135605d3d9445f945cc2021410dbe (diff) | |
download | nextcloud-server-ce339b327f40896a00683618b4155c6223f348c4.tar.gz nextcloud-server-ce339b327f40896a00683618b4155c6223f348c4.zip |
fix(auth): Update authtoken activity selectively
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib')
-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 ea1e5484dda..3a15ba006d4 100644 --- a/lib/private/Authentication/Token/PublicKeyTokenProvider.php +++ b/lib/private/Authentication/Token/PublicKeyTokenProvider.php @@ -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); } diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index d7187639949..0360d57c0eb 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -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; } |