From a14333779170f47fe53a78b2299414a4273d41d0 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Fri, 13 Aug 2021 10:31:51 +0200 Subject: [PATCH] Emit an error log when the app token login name does not match Signed-off-by: Christoph Wurst --- lib/private/User/Session.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index 4ce9951204090..fa6f14fd3ec9d 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -788,9 +788,14 @@ private function validateToken($token, $user = null) { // Check if login names match if (!is_null($user) && $dbToken->getLoginName() !== $user) { - // TODO: this makes it imposssible to use different login names on browser and client + // TODO: this makes it impossible to use different login names on browser and client // e.g. login by e-mail 'user@example.com' on browser for generating the token will not // allow to use the client token with the login name 'user'. + $this->logger->error('App token login name does not match', [ + 'tokenLoginName' => $dbToken->getLoginName(), + 'sessionLoginName' => $user, + ]); + return false; }