mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-07 23:03:00 +03:00
Updated functionality for logging failed access
- Added testing to cover. - Linked logging into Laravel's monolog logging system and made log channel configurable. - Updated env var names to be specific to login access. - Added extra locations as to where failed logins would be captured. Related to #1881 and #728
This commit is contained in:
@@ -401,6 +401,18 @@ class AuthTest extends BrowserKitTest
|
||||
$this->assertFalse(auth('saml2')->check());
|
||||
}
|
||||
|
||||
public function test_failed_logins_are_logged_when_message_configured()
|
||||
{
|
||||
$log = $this->withTestLogger();
|
||||
config()->set(['logging.failed_login.message' => 'Failed login for %u']);
|
||||
|
||||
$this->post('/login', ['email' => 'admin@example.com', 'password' => 'cattreedog']);
|
||||
$this->assertTrue($log->hasWarningThatContains('Failed login for admin@example.com'));
|
||||
|
||||
$this->post('/login', ['email' => 'admin@admin.com', 'password' => 'password']);
|
||||
$this->assertFalse($log->hasWarningThatContains('Failed login for admin@admin.com'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a login
|
||||
*/
|
||||
|
Reference in New Issue
Block a user