add Johan code
This commit is contained in:
@@ -7,6 +7,7 @@ use Doctrine\ORM\EntityManagerInterface;
|
|||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
|
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
|
||||||
use Symfony\Component\Security\Core\Exception\AuthenticationException;
|
use Symfony\Component\Security\Core\Exception\AuthenticationException;
|
||||||
|
use Symfony\Component\Security\Core\Exception\UserNotFoundException;
|
||||||
use Symfony\Component\Security\Core\User\UserInterface;
|
use Symfony\Component\Security\Core\User\UserInterface;
|
||||||
use Symfony\Component\Security\Http\Authenticator\AbstractAuthenticator;
|
use Symfony\Component\Security\Http\Authenticator\AbstractAuthenticator;
|
||||||
use Symfony\Component\Security\Http\Authenticator\Passport\Credentials\PasswordCredentials;
|
use Symfony\Component\Security\Http\Authenticator\Passport\Credentials\PasswordCredentials;
|
||||||
@@ -45,6 +46,10 @@ class LoginFormAuthenticator extends AbstractAuthenticator
|
|||||||
'pseudo' => $identifier
|
'pseudo' => $identifier
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
if (!$user || $user->isActif()) {
|
||||||
|
throw new UserNotFoundException('Utilisateur non trouvé');
|
||||||
|
}
|
||||||
|
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
throw new AuthenticationException('Identifiant ou mot de passe incorrect.');
|
throw new AuthenticationException('Identifiant ou mot de passe incorrect.');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user