Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
| Numéro du ticket | Titre du ticket | |------------------|-----------------| | | | ## Description de la PR ## Modification du .env ## Check list - [ ] Pas de régression - [ ] TU/TI/TF rédigée - [ ] TU/TI/TF OK - [ ] CHANGELOG modifié Reviewed-on: #8 Co-authored-by: tristan <tristan@yuno.malio.fr> Co-committed-by: tristan <tristan@yuno.malio.fr>
28 lines
792 B
PHP
28 lines
792 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Security;
|
|
|
|
use App\Entity\User;
|
|
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
|
use Symfony\Component\Security\Core\Exception\CustomUserMessageAccountStatusException;
|
|
use Symfony\Component\Security\Core\User\UserCheckerInterface;
|
|
use Symfony\Component\Security\Core\User\UserInterface;
|
|
|
|
final class UserChecker implements UserCheckerInterface
|
|
{
|
|
public function checkPreAuth(UserInterface $user): void
|
|
{
|
|
if (!$user instanceof User) {
|
|
return;
|
|
}
|
|
|
|
if ($user->isLocked()) {
|
|
throw new CustomUserMessageAccountStatusException('Ce compte est verrouillé.');
|
|
}
|
|
}
|
|
|
|
public function checkPostAuth(UserInterface $user, ?TokenInterface $token = null): void {}
|
|
}
|