Conditions | 4 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
28 | public function process(Authorization $authorization, callable $next): Authorization |
||
29 | { |
||
30 | try { |
||
31 | $authorization = $next($authorization); |
||
32 | if (false !== strpos($authorization->getQueryParam('response_type'), 'id_token') && !$authorization->hasQueryParam('nonce')) { |
||
33 | throw new \InvalidArgumentException('The parameter "nonce" is mandatory when the response type "id_token" is used.'); |
||
34 | } |
||
35 | |||
36 | return $authorization; |
||
37 | } catch (\InvalidArgumentException $e) { |
||
38 | throw new OAuth2Exception(400, OAuth2Exception::ERROR_INVALID_REQUEST, $e->getMessage(), $authorization, $e); |
||
39 | } |
||
40 | } |
||
41 | } |
||
42 |