src/Controller/IndexController.php line 13
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
class IndexController extends AbstractController
{
#[Route('/', name: 'app_index')]
public function index(AuthorizationCheckerInterface $authorizationChecker): Response
{
if ($authorizationChecker->isGranted('IS_AUTHENTICATED')) {
return $this->redirectToRoute('app_dashboard');
} else {
return $this->redirectToRoute('app_login');
}
}
}