aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Wurst <ChristophWurst@users.noreply.github.com>2024-05-16 12:00:32 +0200
committerGitHub <noreply@github.com>2024-05-16 12:00:32 +0200
commitfe7217d2d3e27ef039b5565378acad96cb8be2ee (patch)
treea35e6be43b5bbb5977510c69030c70ba42856dbf
parent7e1c30f82a63fbea8c269e0eec38291377f32604 (diff)
parent04780ae30a446827880583e9012aaabdb969127e (diff)
downloadnextcloud-server-fe7217d2d3e27ef039b5565378acad96cb8be2ee.tar.gz
nextcloud-server-fe7217d2d3e27ef039b5565378acad96cb8be2ee.zip
Merge pull request #45026 from nextcloud/fix/token-update
Avoid updating the same oc_authtoken row twice
-rw-r--r--config/config.sample.php2
-rw-r--r--lib/private/Authentication/Token/PublicKeyTokenProvider.php2
2 files changed, 3 insertions, 1 deletions
diff --git a/config/config.sample.php b/config/config.sample.php
index c6fab26665d..288ea7e4a9b 100644
--- a/config/config.sample.php
+++ b/config/config.sample.php
@@ -376,7 +376,7 @@ $CONFIG = [
* 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/Authentication/Token/PublicKeyTokenProvider.php b/lib/private/Authentication/Token/PublicKeyTokenProvider.php
index 3a15ba006d4..ea1e5484dda 100644
--- a/lib/private/Authentication/Token/PublicKeyTokenProvider.php
+++ b/lib/private/Authentication/Token/PublicKeyTokenProvider.php
@@ -308,6 +308,8 @@ 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);
}