aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Authentication
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2024-07-10 13:15:20 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2024-07-10 13:28:33 +0200
commit6a783d9b085dab0674f7537c9cec219d175f0399 (patch)
treead1c1044c711d70fe9cf1719de03de2c9c1553ff /lib/private/Authentication
parente31f474fec839079c8a1d436561ec1a4e32e5853 (diff)
downloadnextcloud-server-6a783d9b085dab0674f7537c9cec219d175f0399.tar.gz
nextcloud-server-6a783d9b085dab0674f7537c9cec219d175f0399.zip
fix(Session): avoid race conditions on clustered setups
- re-stablishes old behaviour with cache to return null instead of throwing an InvalidTokenException when the token is cached as non-existing - token invalidation and re-generation are bundled in a DB transaction now Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib/private/Authentication')
-rw-r--r--lib/private/Authentication/Token/PublicKeyTokenProvider.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/Authentication/Token/PublicKeyTokenProvider.php b/lib/private/Authentication/Token/PublicKeyTokenProvider.php
index 767ece1e551..18b850b9377 100644
--- a/lib/private/Authentication/Token/PublicKeyTokenProvider.php
+++ b/lib/private/Authentication/Token/PublicKeyTokenProvider.php
@@ -171,7 +171,7 @@ class PublicKeyTokenProvider implements IProvider {
private function getTokenFromCache(string $tokenHash): ?PublicKeyToken {
$serializedToken = $this->cache->get($tokenHash);
if ($serializedToken === false) {
- throw new InvalidTokenException('Token does not exist: ' . $tokenHash);
+ return null;
}
if ($serializedToken === null) {