diff options
author | David Blajda <blajda@hotmail.com> | 2018-12-18 05:06:05 +0000 |
---|---|---|
committer | David Blajda <blajda@hotmail.com> | 2018-12-18 05:06:05 +0000 |
commit | d34229bc3e495d2927415f408b18aec51a4574e2 (patch) | |
tree | 42f892b93d1459a55b52ccb009ddafd9166e0a8b /src/bin/main.rs | |
parent | 21ebcdb53db06557fe73e195742c038ed91ef331 (diff) |
Implement auth client and auth barrier
Diffstat (limited to 'src/bin/main.rs')
-rw-r--r-- | src/bin/main.rs | 8 |
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| { |