mirror of
https://github.com/nextcloud/server.git
synced 2026-04-20 22:00:39 -04:00
fix(auth): Update authtoken activity selectively
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
parent
54afea4b01
commit
bcc02a3c71
2 changed files with 4 additions and 2 deletions
|
|
@ -308,8 +308,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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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\Authentication\TwoFactorAuth\Manager as TwoFactorAuthManager;
|
||||
use OC\Hooks\Emitter;
|
||||
use OC\Hooks\PublicEmitter;
|
||||
|
|
@ -784,6 +785,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