CustomEntryPoint.php 527 B

12345678910111213141516
  1. <?php
  2. namespace App\Security;
  3. use Symfony\Component\HttpFoundation\RedirectResponse;
  4. use Symfony\Component\HttpFoundation\Request;
  5. use Symfony\Component\Security\Core\Exception\AuthenticationException;
  6. use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface;
  7. class CustomEntryPoint implements AuthenticationEntryPointInterface
  8. {
  9. public function start(Request $request, ?AuthenticationException $authException = null): RedirectResponse
  10. {
  11. return new RedirectResponse('/login');
  12. }
  13. }