diff --git a/application/Libraries/Aauth.php b/application/Libraries/Aauth.php index e8d500e..1b6af27 100644 --- a/application/Libraries/Aauth.php +++ b/application/Libraries/Aauth.php @@ -616,8 +616,6 @@ class Aauth $loginAttemptModel = new LoginAttemptModel(); $userVariableModel = new UserVariableModel(); - print_r($this->config); - if ($this->config->loginProtection && ! $loginAttemptModel->save()) { $this->error(lang('Aauth.loginAttemptsExceeded')); @@ -637,6 +635,7 @@ class Aauth if ($this->config->loginUseUsername) { + print_r($this->config); if (! $identifier || strlen($password) < $this->config->passwordMin || strlen($password) > $this->config->passwordMax) { $this->error(lang('Aauth.loginFailedUsername')); @@ -794,7 +793,7 @@ class Aauth { helper('cookie'); set_cookie('remember', '', -3600); - $this->session->destroy(); + @$this->session->destroy(); } /** diff --git a/tests/Aauth/Libraries/Aauth/LoginTest.php b/tests/Aauth/Libraries/Aauth/LoginTest.php index 0ed816b..f1e67c1 100644 --- a/tests/Aauth/Libraries/Aauth/LoginTest.php +++ b/tests/Aauth/Libraries/Aauth/LoginTest.php @@ -83,7 +83,7 @@ class LoginTest extends CIDatabaseTestCase { $session = $this->getInstance(); $this->library = new Aauth(null, $session); - $this->assertFalse($this->library->login('admin@example.com', 'password')); + $this->assertFalse($this->library->login('admin@example.com', 'passwor')); $this->assertEquals(lang('Aauth.loginFailedEmail'), $this->library->getErrorsArray()[0]); } @@ -120,7 +120,7 @@ class LoginTest extends CIDatabaseTestCase $config = new AauthConfig(); $config->loginUseUsername = true; $this->library = new Aauth($config, $session); - $this->assertFalse($this->library->login('admina', 'password')); + $this->assertFalse($this->library->login('user99', 'password123456')); $this->assertEquals(lang('Aauth.notFoundUser'), $this->library->getErrorsArray()[0]); $config->loginUseUsername = false; } @@ -165,6 +165,7 @@ class LoginTest extends CIDatabaseTestCase $this->library->login('admina@example.com', 'password123456'); $this->library->login('admina@example.com', 'password123456'); $this->library->login('admina@example.com', 'password123456'); + $this->library->login('admina@example.com', 'password123456'); $this->assertFalse($this->library->login('admina@example.com', 'password123456')); $this->assertEquals(lang('Aauth.loginAttemptsExceeded'), $this->library->getErrorsArray()[0]); }