소스 검색

Mauvaise exception

François Drouhard 2 년 전
부모
커밋
8052773512
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      src/Security/UserChecker.php

+ 3 - 3
src/Security/UserChecker.php

@@ -3,7 +3,7 @@
 namespace App\Security;
 
 use App\Entity\User as AppUser;
-use Symfony\Component\Security\Core\Exception\CredentialsExpiredException;
+use Symfony\Component\Security\Core\Exception\AccountExpiredException;
 use Symfony\Component\Security\Core\User\UserCheckerInterface;
 use Symfony\Component\Security\Core\User\UserInterface;
 
@@ -21,12 +21,12 @@ class UserChecker implements UserCheckerInterface
     {
         if (!$user instanceof AppUser)
         {
-            dump($user);
             return;
         }
         if (!$user->isEnabled())
         {
-            throw new CredentialsExpiredException("Ce compte n'a pas été activé");
+            dump($user);
+            throw new AccountExpiredException("Ce compte n'a pas été activé");
         }
     }
 }