Do not restore loginCount if feature is not used. Fixes #1.
This commit is contained in:
1 file changed
+5
-1
@@ -74,7 +74,11 @@ final class InvalidAttemptsListener
|
||||
*/
|
||||
public function onPostLogin(User $user): void
|
||||
{
|
||||
$user->loginCount = $this->getMaximumInvalidAttempts(\get_class($user));
|
||||
if (null === $maximumAttempts = $this->getMaximumInvalidAttempts(\get_class($user))) {
|
||||
return;
|
||||
}
|
||||
|
||||
$user->loginCount = $maximumAttempts;
|
||||
$user->save();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user