| @@ 76-84 (lines=9) @@ | ||
| 73 | /** |
|
| 74 | * @inheritdoc |
|
| 75 | */ |
|
| 76 | public function onAuthenticationFailure(Request $request, AuthenticationException $exception) |
|
| 77 | { |
|
| 78 | $data = [ |
|
| 79 | 'code' => '403', |
|
| 80 | 'message' => 'Forbidden. You don\'t have necessary permissions for the resource' |
|
| 81 | ]; |
|
| 82 | ||
| 83 | return new JsonResponse($data, Response::HTTP_FORBIDDEN); |
|
| 84 | } |
|
| 85 | ||
| 86 | /** |
|
| 87 | * @inheritdoc |
|
| @@ 89-97 (lines=9) @@ | ||
| 86 | /** |
|
| 87 | * @inheritdoc |
|
| 88 | */ |
|
| 89 | public function start(Request $request, AuthenticationException $authException = null) |
|
| 90 | { |
|
| 91 | $data = [ |
|
| 92 | 'code' => '401', |
|
| 93 | 'message' => 'Authentication required' |
|
| 94 | ]; |
|
| 95 | ||
| 96 | return new JsonResponse($data, Response::HTTP_UNAUTHORIZED); |
|
| 97 | } |
|
| 98 | ||
| 99 | /** |
|
| 100 | * @inheritdoc |
|