Commit cbf16252 authored by Mat's avatar Mat

Merge branch 'test_seecurity_bearer'

parents 2929163c 0815c85e
......@@ -54,7 +54,7 @@ $(document).ready(function()
if (!options.beforeSend) {
options.beforeSend = function(xhr) {
// avec 2 espaces entre bearer et le token !!!!
xhr.setRequestHeader('Authorization', 'bearer ' + sessionStorage.getItem('token'));
xhr.setRequestHeader('Authorization', 'bearer ' + sessionStorage.getItem('token'));
}
}
});
......
......@@ -13,8 +13,8 @@ use Symfony\Component\HttpFoundation\Request;
/**
* Class BrasserieController
*
* //@Security("has_role('ROLE_USER')")
* @package Api2Bundle\Controller
* @Security("has_role('ROLE_USER')")
*/
class BrasserieController extends FOSRestController
{
......@@ -23,8 +23,9 @@ class BrasserieController extends FOSRestController
* @Rest\Get(path="/brasserie")
* @Rest\View(serializerGroups={"getBrasserie"})
*/
public function getAction()
public function getAction(Request $request)
{
//dump($request); die;
return $this->getDoctrine()
->getRepository(Brasserie::class)
->findAll();
......@@ -41,7 +42,6 @@ class BrasserieController extends FOSRestController
public function putAction(Request $request, Brasserie $id)
{
// le fait de typer $id fait qu'il retourne un objet !
//dump($request); die;
$form = $this->createForm(BrasserieType::class, $id,
array(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment