| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace nyx\auth\id\protocols\oauth2\providers; |
||
| 46 | protected function getDefaultRequestOptions(auth\interfaces\Token $token = null) : array |
||
| 47 | { |
||
| 48 | if (null === $token) { |
||
| 49 | return parent::getDefaultRequestOptions($token); |
||
| 50 | } |
||
| 51 | |||
| 52 | // Slack expects the token to be present in each authorized request as the 'token' parameter. |
||
| 53 | // Note: Passing it in the body yielded 'not_authed' (ie. no token) errors from Slack. |
||
| 54 | return array_merge_recursive(parent::getDefaultRequestOptions(), [ |
||
| 55 | 'query' => [ |
||
| 56 | 'token' => $token->getId() |
||
| 57 | ] |
||
| 58 | ]); |
||
| 59 | } |
||
| 60 | } |
||
| 61 |