]> source.dussan.org Git - nextcloud-server.git/commitdiff
fixes the throttler not checking the user state on postLogin 20299/head
authorArthur Schiwon <blizzz@arthur-schiwon.de>
Fri, 3 Apr 2020 20:51:46 +0000 (22:51 +0200)
committerArthur Schiwon <blizzz@arthur-schiwon.de>
Fri, 3 Apr 2020 20:51:46 +0000 (22:51 +0200)
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 <blizzz@arthur-schiwon.de>
lib/base.php

index 4c96e3470cd266b20618a2ceda9ba55504b186b5..6dc5948d53c5462c7ca7c50f96ec16b741d8007c 100644 (file)
@@ -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();