Skip to content

Commit

Permalink
fix(session): Avoid two useless authtoken DB queries for every anonym…
Browse files Browse the repository at this point in the history
…ous request

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
  • Loading branch information
solracsf authored Jan 6, 2024
1 parent 2e10c94 commit 89d075d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/private/User/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,13 @@ public function tryTokenLogin(IRequest $request) {
return false;
}

// Check if the request had sent a cookie with the instance id as name
// If there is no cookie, this is a new session
$instanceId = $this->config->getSystemValueString('instanceid');
if (is_null($request->getCookie($instanceId))) {
return false;
}

try {
$dbToken = $this->tokenProvider->getToken($token);
} catch (InvalidTokenException $e) {
Expand Down

0 comments on commit 89d075d

Please sign in to comment.