Merge pull request #45026 from nextcloud/fix/token-update

Avoid updating the same oc_authtoken row twice
pull/45355/head
Christoph Wurst 2 years ago committed by GitHub
commit fe7217d2d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      config/config.sample.php
  2. 2
      lib/private/Authentication/Token/PublicKeyTokenProvider.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,

@ -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);
}

Loading…
Cancel
Save