<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class DefaultController extends AbstractController
{
#[Route('/', name: 'app_default')]
public function index(): Response
{
$usuario= $this->get('security.token_storage')->getToken()->getUser();
if (in_array('ROLE_EXTERNO', $usuario->getRoles(), true)) {
return $this->redirectToRoute('app_comun_proyecto_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('default/index.html.twig', [
]);
}
}