Page MenuHomePhorge

D25056.1737733072.diff
No OneTemporary

D25056.1737733072.diff

diff --git a/src/future/twitch/PhutilTwitchFuture.php b/src/future/twitch/PhutilTwitchFuture.php
--- a/src/future/twitch/PhutilTwitchFuture.php
+++ b/src/future/twitch/PhutilTwitchFuture.php
@@ -47,12 +47,12 @@
}
$uri = new PhutilURI('https://api.twitch.tv/');
- $uri->setPath('/kraken/'.ltrim($this->action, '/'));
- $uri->replaceQueryParam('oauth_token', $this->accessToken);
+ $uri->setPath('/helix/'.ltrim($this->action, '/'));
$future = new HTTPSFuture($uri);
$future->setData($this->params);
$future->setMethod($this->method);
+ $future->addHeader('Authorization', 'Bearer '.$this->accessToken);
// NOTE: This is how the Twitch API is versioned.
$future->addHeader('Accept', 'application/vnd.twitchtv.2+json');
@@ -87,7 +87,7 @@
throw new Exception(pht('Received error from Twitch: %s', $error));
}
- return $data;
+ return $data['data'][0];
}
}

File Metadata

Mime Type
text/plain
Expires
Fri, Jan 24, 15:37 (5 d, 21 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1108657
Default Alt Text
D25056.1737733072.diff (954 B)

Event Timeline