From e52442e26f475213dfb7591fb0df1d3c516fbd51 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Fri, 3 Apr 2020 22:51:46 +0200 Subject: [PATCH] fixes the throttler not checking the user state on postLogin a listener to the post login events can still reject a login, so that a user is not necessarily available at the time. Signed-off-by: Arthur Schiwon --- lib/base.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/base.php b/lib/base.php index 4c96e3470cd..6dc5948d53c 100644 --- a/lib/base.php +++ b/lib/base.php @@ -812,7 +812,7 @@ class OC { // NOTE: This will be replaced to use OCP $userSession = self::$server->getUserSession(); $userSession->listen('\OC\User', 'postLogin', function () use ($userSession) { - if (!defined('PHPUNIT_RUN')) { + if (!defined('PHPUNIT_RUN') && $userSession->isLoggedIn()) { // reset brute force delay for this IP address and username $uid = \OC::$server->getUserSession()->getUser()->getUID(); $request = \OC::$server->getRequest(); -- 2.39.5