fix(auth): Update authtoken activity selectively

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
pull/45411/head
Christoph Wurst 2 years ago
parent 54afea4b01
commit bcc02a3c71
No known key found for this signature in database
GPG Key ID: CC42AC2A7F0E56D8
  1. 2
      lib/private/Authentication/Token/PublicKeyTokenProvider.php
  2. 4
      lib/private/User/Session.php

@ -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…
Cancel
Save