Skip to content

Commit

Permalink
Merge pull request #45026 from nextcloud/fix/token-update
Browse files Browse the repository at this point in the history
Avoid updating the same oc_authtoken row twice
  • Loading branch information
ChristophWurst authored May 16, 2024
2 parents 7e1c30f + 04780ae commit fe7217d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@
* Tokens are still checked every 5 minutes for validity
* max value: 300
*
* Defaults to ``300``
* Defaults to ``60``
*/
'token_auth_activity_update' => 60,

Expand Down
2 changes: 2 additions & 0 deletions lib/private/Authentication/Token/PublicKeyTokenProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,8 @@ public function updateToken(OCPIToken $token) {
if (!($token instanceof PublicKeyToken)) {
throw new InvalidTokenException("Invalid token type");
}
$now = $this->time->getTime();
$token->setLastActivity($now);
$this->mapper->update($token);
$this->cacheToken($token);
}
Expand Down

0 comments on commit fe7217d

Please sign in to comment.