mirror of
https://github.com/nextcloud/server.git
synced 2026-03-07 07:50:57 -05:00
Merge pull request #45411 from nextcloud/fix/auth/selective-token-activity-update
fix(auth): Update authtoken activity selectively
This commit is contained in:
commit
fca38e12c8
2 changed files with 4 additions and 2 deletions
|
|
@ -286,8 +286,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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,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;
|
||||
|
|
@ -752,6 +753,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