Skip to content

Commit 8593595

Browse files
CarlSchwanbackportbot[bot]
authored andcommitted
fix: Add backtrace when login fails
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
1 parent aa73b78 commit 8593595

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

lib/private/User/Session.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ public function logClientIn($user,
464464
}
465465

466466
private function handleLoginFailed(IThrottler $throttler, int $currentDelay, string $remoteAddress, string $user, ?string $password) {
467-
$this->logger->warning("Login failed: '" . $user . "' (Remote IP: '" . $remoteAddress . "')", ['app' => 'core']);
467+
$this->logger->warning("Login failed: '" . $user . "' (Remote IP: '" . $remoteAddress . "')", ['app' => 'core', 'exception' => new \Exception()]);
468468

469469
$throttler->registerAttempt('login', $remoteAddress, ['user' => $user]);
470470
$this->dispatcher->dispatchTyped(new LoginFailed($user, $password));
@@ -761,11 +761,9 @@ private function checkTokenCredentials(IToken $dbToken, $token, array &$reason)
761761
*
762762
* Invalidates the token if checks fail
763763
*
764-
* @param string $token
765-
* @param string $user login name
766-
* @return boolean
764+
* @param ?string $user The login name
767765
*/
768-
private function validateToken($token, $user = null) {
766+
private function validateToken(string $token, ?string $user = null): bool {
769767
try {
770768
$dbToken = $this->tokenProvider->getToken($token);
771769
} catch (InvalidTokenException $ex) {

0 commit comments

Comments
 (0)