Explorar o código

Mauvaise exception

François Drouhard %!s(int64=2) %!d(string=hai) anos
pai
achega
8052773512
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  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é");
         }
     }
 }