summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorblizzz <blizzz@arthur-schiwon.de>2022-09-27 08:45:13 +0200
committerGitHub <noreply@github.com>2022-09-27 08:45:13 +0200
commit0afc3d597f2570048f23155af54ff63e595210f1 (patch)
treeb25e3b0060e9a975b0f6ba3dd52f911e827cffcd /lib/private
parenteb43075240a777f1b8da9e804762ba9278e86899 (diff)
parentc39135a294cd41e5cb3750e012815492abc91cf1 (diff)
downloadnextcloud-server-0afc3d597f2570048f23155af54ff63e595210f1.tar.gz
nextcloud-server-0afc3d597f2570048f23155af54ff63e595210f1.zip
Merge pull request #33787 from nextcloud/backport/33772/stable24
[stable24] Log if cookie login failed with token mismatch or session unavailability
Diffstat (limited to 'lib/private')
-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 365a01c4595..a0e0e5c1dc8 100644
--- a/lib/private/User/Session.php
+++ b/lib/private/User/Session.php
@@ -865,6 +865,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
@@ -876,6 +880,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) {
$this->logger->warning('Renewing session token failed', ['app' => 'core']);