From: Raphaƫl Gertz <git@rapsys.eu>
Date: Mon, 11 Dec 2023 02:13:56 +0000 (+0100)
Subject: Add is enabled check
X-Git-Tag: 0.3.1~10
X-Git-Url: https://git.rapsys.eu/userbundle/commitdiff_plain/3e7a34ac74e57f4a78d75dcc1f05438759b7ee03

Add is enabled check
---

diff --git a/Checker/UserChecker.php b/Checker/UserChecker.php
index 744a35e..7ea72ff 100644
--- a/Checker/UserChecker.php
+++ b/Checker/UserChecker.php
@@ -38,6 +38,13 @@ class UserChecker extends InMemoryUserChecker {
 			throw $ex;
 		}
 
+		//With not enabled user
+		if (!$user->isEnabled()) {
+			$ex = new DisabledException('User account is not enabled');
+			$ex->setUser($user);
+			throw $ex;
+		}
+
 		//Call parent checkPreAuth
 		parent::checkPostAuth($user);
 	}