mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
feat: add /me endpoint
This commit is contained in:
23
src/Controller/MeController.php
Normal file
23
src/Controller/MeController.php
Normal 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();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user