aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2022-08-31 10:37:48 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2022-08-31 14:55:51 +0200
commit0184fbe86baa79641aa724887b92fbcef2cef08d (patch)
tree08ae7c4b2b7d6fbdb35f942359e69a0850d00e97
parent9318483540105bb7dbf950d0191e64d934e5acdc (diff)
downloadnextcloud-server-0184fbe86baa79641aa724887b92fbcef2cef08d.tar.gz
nextcloud-server-0184fbe86baa79641aa724887b92fbcef2cef08d.zip
Log if cookie login failed with token mismatch or session unavailability
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
-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 626ddca2dad..65a213d4bf8 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']);