X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FApiBundle%2FController%2FDeveloperController.php;h=c8a1c6355b9f11a1b7a15dc4acd13eb282811b73;hb=f808b01692a835673f328d7221ba8c212caa9b61;hp=9cb1b626456884cd615ecb4178e0371b6dbdd330;hpb=339b1e689d96b433d88ca1ad2325031841ae450d;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/ApiBundle/Controller/DeveloperController.php b/src/Wallabag/ApiBundle/Controller/DeveloperController.php index 9cb1b626..c8a1c635 100644 --- a/src/Wallabag/ApiBundle/Controller/DeveloperController.php +++ b/src/Wallabag/ApiBundle/Controller/DeveloperController.php @@ -3,8 +3,8 @@ namespace Wallabag\ApiBundle\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; -use Symfony\Component\HttpFoundation\Request; use Symfony\Bundle\FrameworkBundle\Controller\Controller; +use Symfony\Component\HttpFoundation\Request; use Wallabag\ApiBundle\Entity\Client; use Wallabag\ApiBundle\Form\Type\ClientType; @@ -43,7 +43,7 @@ class DeveloperController extends Controller $clientForm->handleRequest($request); if ($clientForm->isSubmitted() && $clientForm->isValid()) { - $client->setAllowedGrantTypes(['token', 'authorization_code', 'password', 'refresh_token']); + $client->setAllowedGrantTypes(['client_credentials', 'token', 'authorization_code', 'password', 'refresh_token']); $em->persist($client); $em->flush(); @@ -75,7 +75,7 @@ class DeveloperController extends Controller */ public function deleteClientAction(Client $client) { - if (null === $this->getUser() || $client->getUser()->getId() != $this->getUser()->getId()) { + if (null === $this->getUser() || $client->getUser()->getId() !== $this->getUser()->getId()) { throw $this->createAccessDeniedException('You can not access this client.'); }