src/Security/Listener/DefaultPassportListener.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Security\Listener;
  3. use App\Security\Event\BuildPassport;
  4. use Symfony\Component\Security\Http\Authenticator\Passport\Badge\PreAuthenticatedUserBadge;
  5. use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge;
  6. use Symfony\Component\Security\Http\Authenticator\Passport\SelfValidatingPassport;
  7. class DefaultPassportListener
  8. {
  9.     public function __invoke(BuildPassport $event): void
  10.     {
  11.         // example passport that requires no authentication.
  12.         // $event->setPassport(new SelfValidatingPassport(new UserBadge($event->id()), [new PreAuthenticatedUserBadge()]));
  13.     }
  14. }