mirror of
https://github.com/nextcloud/server.git
synced 2026-06-06 15:23:17 -04:00
Merge pull request #45349 from nextcloud/backport/45026/stable28
[stable28] Avoid updating the same oc_authtoken row twice
This commit is contained in:
commit
aac7365d7e
2 changed files with 5 additions and 1 deletions
|
|
@ -355,7 +355,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,
|
||||
|
||||
|
|
|
|||
|
|
@ -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\Hooks\Emitter;
|
||||
use OC\Hooks\PublicEmitter;
|
||||
use OC_User;
|
||||
|
|
@ -774,6 +775,9 @@ class Session implements IUserSession, Emitter {
|
|||
}
|
||||
|
||||
$dbToken->setLastCheck($now);
|
||||
if ($dbToken instanceof PublicKeyToken) {
|
||||
$dbToken->setLastActivity($now);
|
||||
}
|
||||
$this->tokenProvider->updateToken($dbToken);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue