Untested login
This commit is contained in:
parent
615a516ac2
commit
ef9eecfdea
18
src/Controller/SecurityController.php
Normal file
18
src/Controller/SecurityController.php
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?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
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
@ -16,8 +16,7 @@ use Symfony\Component\Serializer\Attribute\Groups;
|
|||||||
operations: [
|
operations: [
|
||||||
new Get(normalizationContext: ['groups' => 'building:item']),
|
new Get(normalizationContext: ['groups' => 'building:item']),
|
||||||
new GetCollection(normalizationContext: ['groups' => 'building:list']),
|
new GetCollection(normalizationContext: ['groups' => 'building:list']),
|
||||||
// TODO Security!!
|
new Post(security: "is_granted('ROLE_USER')"),
|
||||||
new Post(),
|
|
||||||
],
|
],
|
||||||
order: ['name' => 'DESC'],
|
order: ['name' => 'DESC'],
|
||||||
paginationEnabled: false,
|
paginationEnabled: false,
|
||||||
|
Loading…
Reference in New Issue
Block a user