Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php namespace nyx\auth\id\protocols\oauth2\providers; |
||
38 | protected function getDefaultRequestOptions(auth\interfaces\Token $token = null) : array |
||
39 | { |
||
40 | $options = [ |
||
41 | 'headers' => [ |
||
42 | 'Accept' => 'application/vnd.twitchtv.v3+json' |
||
43 | ] |
||
44 | ]; |
||
45 | |||
46 | // Twitch uses a non-default authorization header. |
||
47 | if (isset($token)) { |
||
48 | $options['headers']['Authorization'] = 'OAuth '.$token->getId(); |
||
49 | } |
||
50 | |||
51 | // Note: No parent call in the flow. |
||
52 | return $options; |
||
53 | } |
||
54 | } |
||
55 |