webarchi/src/Controller/SecurityController.php
2024-12-19 10:18:02 +01:00

19 lines
431 B
PHP

<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
class SecurityController extends AbstractController
{
#[Route('/login', name: 'app_login')]
public function index(): Response
{
return $this->json([
$this->getUser()?->getId() ?? null
]);
}
}