src/Security/AccessDeniedHandler.php line 14
<?phpnamespace App\Security;use Symfony\Component\HttpFoundation\Request;use Symfony\Component\HttpFoundation\Response;use Symfony\Component\Security\Core\Exception\AccessDeniedException;use Symfony\Component\Security\Http\Authorization\AccessDeniedHandlerInterface;use Symfony\Component\HttpFoundation\RedirectResponse;use Symfony\Component\Routing\RouterInterface;class AccessDeniedHandler implements AccessDeniedHandlerInterface{public function __construct(RouterInterface $router){$this->router = $router;}public function handle(Request $request, AccessDeniedException $accessDeniedException): ?Response{// ...return new RedirectResponse($this->router->generate('app_error_access'));}}