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