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 <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2020-04-03 22:51:46 +02:00
parent 2d0f29f208
commit e52442e26f
No known key found for this signature in database
GPG Key ID: 7424F1874854DF23
1 changed files with 1 additions and 1 deletions

View 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();