Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
25 | public function postAction(Request $request) |
||
26 | { |
||
27 | try { |
||
28 | return $this->createJsonResponse($this->get('oauth.server')->grant( |
||
29 | $this->getRequestData($request, 'snakelize') |
||
30 | )); |
||
31 | } catch (InvalidGrantException $e) { |
||
32 | return new JsonResponse('Unavailable to create access token : bad credentials.', 401); |
||
33 | } catch (\InvalidArgumentException $e) { |
||
34 | return new JsonResponse('Invalid or missing fields for grant type.', 400); |
||
35 | } |
||
36 | } |
||
37 | } |
||
38 |