Conditions | 4 |
Paths | 3 |
Total Lines | 29 |
Code Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
29 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
||
30 | { |
||
31 | try { |
||
32 | return $handler->handle($request); |
||
33 | } catch (OAuth2AuthorizationException $e) { |
||
34 | $redirectUri = $e->getAuthorization()->getRedirectUri(); |
||
35 | $responseMode = $e->getAuthorization()->getResponseMode(); |
||
36 | if (null !== $redirectUri && null !== $responseMode) { |
||
37 | throw new OAuth2Message( |
||
38 | 302, |
||
39 | $e->getMessage(), |
||
40 | $e->getErrorDescription(), |
||
41 | [ |
||
42 | 'response_mode' => $responseMode, |
||
43 | 'redirect_uri' => $redirectUri, |
||
44 | ], |
||
45 | $e |
||
46 | ); |
||
47 | } else { |
||
48 | throw new OAuth2Message( |
||
49 | 400, |
||
50 | $e->getMessage(), |
||
51 | $e->getErrorDescription(), |
||
52 | [], |
||
53 | $e |
||
54 | ); |
||
55 | } |
||
56 | } |
||
57 | } |
||
58 | } |
||
59 |