Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorblizzz <blizzz@arthur-schiwon.de>2022-09-28 00:26:55 +0300
committerGitHub <noreply@github.com>2022-09-28 00:26:55 +0300
commit67181d6b01f270115880970ff9b7a6589267b596 (patch)
treef6c49b0adc891d6fa88b15809820198fd4ee0eb9
parent187aeb6c3665fee1eda9c5cadeaf068ed43d07b0 (diff)
parent2fbcc9184bc470ff57ed00171c54a619906972c8 (diff)
Merge pull request #33786 from nextcloud/backport/33772/stable23
[stable23] Log if cookie login failed with token mismatch or session unavailability
-rw-r--r--lib/private/User/Session.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php
index 8f910113078..d3ccb24fdf8 100644
--- a/lib/private/User/Session.php
+++ b/lib/private/User/Session.php
@@ -880,6 +880,10 @@ class Session implements IUserSession, Emitter {
$tokens = $this->config->getUserKeys($uid, 'login_token');
// test cookies token against stored tokens
if (!in_array($currentToken, $tokens, true)) {
+ $this->logger->error('Tried to log in {uid} but could not verify token', [
+ 'app' => 'core',
+ 'uid' => $uid,
+ ]);
return false;
}
// replace successfully used token with a new one
@@ -891,6 +895,10 @@ class Session implements IUserSession, Emitter {
$sessionId = $this->session->getId();
$token = $this->tokenProvider->renewSessionToken($oldSessionId, $sessionId);
} catch (SessionNotAvailableException $ex) {
+ $this->logger->warning('Could not renew session token for {uid} because the session is unavailable', [
+ 'app' => 'core',
+ 'uid' => $uid,
+ ]);
return false;
} catch (InvalidTokenException $ex) {
\OC::$server->getLogger()->warning('Renewing session token failed', ['app' => 'core']);