Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (20 sloc) 593 Bytes
<?php
namespace App\Controller\Api;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Routing\Annotation\Route;
class SecurityController extends AbstractController
{
/**
* @Route("/api/login", name="api_login", methods={"POST"})
*/
public function login()
{
$user = $this->getUser();
return new JsonResponse([
'apiToken' => $user->getApiToken(),
'roles' => $user->getRoles(),
'email' => $user->getEmail(),
]);
}
}
You can’t perform that action at this time.