feat: add /me endpoint

This commit is contained in:
Maël Gangloff
2024-07-18 12:36:01 +02:00
parent 9d88599d86
commit 2efc3da018
4 changed files with 54 additions and 7 deletions

View File

@@ -0,0 +1,23 @@
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\Security\Core\User\UserInterface;
class MeController extends AbstractController
{
public function __construct(
private readonly Security $security
)
{
}
public function __invoke(): UserInterface
{
return $this->security->getUser();
}
}