Do not restore loginCount if feature is not used. Fixes #1.

This commit is contained in:
Richard Henkenjohann committed 2019-09-17 20:38:49 +09:00
1 parent 2851fa5b92
commit 98df380d46
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();
}