| @@ 63-80 (lines=18) @@ | ||
| 60 | { |
|
| 61 | $service->get( |
|
| 62 | $this->options['route_prefix'].'/authorize', |
|
| 63 | function (Request $request, UserInfoInterface $userInfo) { |
|
| 64 | $authorize = $this->server->getAuthorize($request, $userInfo); |
|
| 65 | if ($authorize instanceof Response) { |
|
| 66 | return $authorize; |
|
| 67 | } |
|
| 68 | // XXX here authorize must be array type! |
|
| 69 | $response = new Response(); |
|
| 70 | $response->setHeader('X-Frame-Options', 'DENY'); |
|
| 71 | $response->setHeader('Content-Security-Policy', "default-src 'self'"); |
|
| 72 | $response->setBody( |
|
| 73 | $this->templateManager->render( |
|
| 74 | 'getAuthorize', |
|
| 75 | $authorize |
|
| 76 | ) |
|
| 77 | ); |
|
| 78 | ||
| 79 | return $response; |
|
| 80 | }, |
|
| 81 | [ |
|
| 82 | 'fkooman\Rest\Plugin\Authentication\AuthenticationPlugin' => [ |
|
| 83 | 'activate' => ['user'], |
|
| @@ 65-82 (lines=18) @@ | ||
| 62 | { |
|
| 63 | $this->get( |
|
| 64 | $this->options['route_prefix'].'/authorize', |
|
| 65 | function (Request $request, UserInfoInterface $userInfo) { |
|
| 66 | $authorize = $this->server->getAuthorize($request, $userInfo); |
|
| 67 | if ($authorize instanceof Response) { |
|
| 68 | return $authorize; |
|
| 69 | } |
|
| 70 | // XXX here authorize must be array type! |
|
| 71 | $response = new Response(); |
|
| 72 | $response->setHeader('X-Frame-Options', 'DENY'); |
|
| 73 | $response->setHeader('Content-Security-Policy', "default-src 'self'"); |
|
| 74 | $response->setBody( |
|
| 75 | $this->templateManager->render( |
|
| 76 | 'getAuthorize', |
|
| 77 | $authorize |
|
| 78 | ) |
|
| 79 | ); |
|
| 80 | ||
| 81 | return $response; |
|
| 82 | }, |
|
| 83 | [ |
|
| 84 | 'fkooman\Rest\Plugin\Authentication\AuthenticationPlugin' => [ |
|
| 85 | 'activate' => ['user'], |
|