From 1aaf9f02a868b5e98e9dc6ac65ebaaaf0ad97f18 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 12 Nov 2021 14:43:23 +0100 Subject: [PATCH 1/2] Fix missing token update Signed-off-by: Joas Schilling --- lib/private/User/Session.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index fa6f14fd3ec9d..710cba84879af 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -750,6 +750,7 @@ private function checkTokenCredentials(IToken $dbToken, $token) { } $dbToken->setLastCheck($now); + $this->tokenProvider->updateToken($dbToken); return true; } @@ -767,6 +768,7 @@ private function checkTokenCredentials(IToken $dbToken, $token) { } $dbToken->setLastCheck($now); + $this->tokenProvider->updateToken($dbToken); return true; } From 6ed9bccb3d4ad0a5f212df8047c181063a4483dc Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 12 Nov 2021 15:01:56 +0100 Subject: [PATCH 2/2] Fix unit tests Signed-off-by: Joas Schilling --- tests/lib/User/SessionTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/lib/User/SessionTest.php b/tests/lib/User/SessionTest.php index 8f72ba06b9218..334c3d9065fa1 100644 --- a/tests/lib/User/SessionTest.php +++ b/tests/lib/User/SessionTest.php @@ -1264,7 +1264,7 @@ public function testUpdateAuthTokenLastCheck() { $mapper->expects($this->any()) ->method('getToken') ->willReturn($token); - $mapper->expects($this->once()) + $mapper->expects($this->exactly(2)) ->method('update'); $request ->expects($this->any()) @@ -1314,7 +1314,7 @@ public function testNoUpdateAuthTokenLastCheckRecent() { $mapper->expects($this->any()) ->method('getToken') ->willReturn($token); - $mapper->expects($this->never()) + $mapper->expects($this->once()) ->method('update'); $request ->expects($this->any())