fix(auth): successful login no longer resets IP failure counter
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
e34362b9bd
commit
7f41c27958
@@ -53,7 +53,21 @@ class LoginThrottleTest extends TestCase
|
||||
|
||||
$this->travel(21)->minutes();
|
||||
$this->login('staff', 'correct-password-123')->assertOk();
|
||||
$this->assertSame(0, AdminLoginBlock::count());
|
||||
}
|
||||
|
||||
public function test_successful_login_does_not_reset_failures_of_the_ip(): void
|
||||
{
|
||||
$this->staff();
|
||||
User::factory()->create(['username' => 'victim', 'password' => Hash::make('victim-password-123')]);
|
||||
|
||||
for ($i = 0; $i < 4; $i++) {
|
||||
$this->login('victim', 'guess-' . $i)->assertUnauthorized();
|
||||
$this->login('staff', 'correct-password-123')->assertOk();
|
||||
$this->app['auth']->forgetGuards();
|
||||
}
|
||||
|
||||
$this->login('victim', 'guess-final')->assertStatus(429);
|
||||
$this->assertTrue(AdminLoginBlock::sole()->isBlocked());
|
||||
}
|
||||
|
||||
public function test_successful_login_alerts_configured_recipients(): void
|
||||
|
||||
Reference in New Issue
Block a user