Skip to content

Commit

Permalink
Merge pull request #29685 from nextcloud/backport/29682/stable22
Browse files Browse the repository at this point in the history
[stable22] Fix missing token update
  • Loading branch information
blizzz authored Nov 12, 2021
2 parents 92db6f3 + 6ed9bcc commit b6adf29
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/private/User/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,7 @@ private function checkTokenCredentials(IToken $dbToken, $token) {
}

$dbToken->setLastCheck($now);
$this->tokenProvider->updateToken($dbToken);
return true;
}

Expand All @@ -767,6 +768,7 @@ private function checkTokenCredentials(IToken $dbToken, $token) {
}

$dbToken->setLastCheck($now);
$this->tokenProvider->updateToken($dbToken);
return true;
}

Expand Down
4 changes: 2 additions & 2 deletions tests/lib/User/SessionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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())
Expand Down

0 comments on commit b6adf29

Please sign in to comment.