summaryrefslogtreecommitdiff
path: root/src/bin/main.rs
diff options
context:
space:
mode:
authorDavid Blajda <blajda@hotmail.com>2018-12-18 05:06:05 +0000
committerDavid Blajda <blajda@hotmail.com>2018-12-18 05:06:05 +0000
commitd34229bc3e495d2927415f408b18aec51a4574e2 (patch)
tree42f892b93d1459a55b52ccb009ddafd9166e0a8b /src/bin/main.rs
parent21ebcdb53db06557fe73e195742c038ed91ef331 (diff)
Implement auth client and auth barrier
Diffstat (limited to 'src/bin/main.rs')
-rw-r--r--src/bin/main.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/bin/main.rs b/src/bin/main.rs
index dbaaa41..9e01a29 100644
--- a/src/bin/main.rs
+++ b/src/bin/main.rs
@@ -7,6 +7,7 @@ extern crate twitch_api;
use futures::future::Future;
use std::env;
use twitch_api::Client;
+use twitch_api::HelixClient;
fn main() {
dotenv::dotenv().unwrap();
@@ -14,7 +15,12 @@ fn main() {
let client = Client::new(client_id);
- let clip = client.helix
+ let authed_client =
+ client.helix.clone()
+ .authenticate(&env::var("TWITCH_SECRET").unwrap())
+ .build();
+
+ let clip = authed_client
.clips()
.clip(&"EnergeticApatheticTarsierThisIsSparta")
.map_err(|err| {