summaryrefslogtreecommitdiff
path: root/src/helix/namespaces/auth.rs
diff options
context:
space:
mode:
authorDavid Blajda <blajda@hotmail.com>2018-12-20 23:42:45 +0000
committerDavid Blajda <blajda@hotmail.com>2018-12-20 23:42:45 +0000
commit298806448db4a4e74306ec648bfc0e43a76c6bc3 (patch)
tree1cdd90df0d65a513ad94588dae7621b03a906b3e /src/helix/namespaces/auth.rs
parent2bae9a4e8d8b77f8a99df6829547a60f883632a3 (diff)
Split auth and unauth client and created ClientTrait
Diffstat (limited to 'src/helix/namespaces/auth.rs')
-rw-r--r--src/helix/namespaces/auth.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/helix/namespaces/auth.rs b/src/helix/namespaces/auth.rs
index 5efc0fe..478c1af 100644
--- a/src/helix/namespaces/auth.rs
+++ b/src/helix/namespaces/auth.rs
@@ -1,9 +1,9 @@
-use futures::future::Future;
use std::collections::BTreeMap;
use super::super::models::Credentials;
use super::super::Client;
const ID_DOMAIN: &'static str = "id.twitch.tv";
-use super::super::Namespace;
+use super::Namespace;
+use super::super::ClientTrait;
pub struct Auth {}
type AuthNamespace = Namespace<Auth>;
@@ -34,10 +34,10 @@ pub fn client_credentials(client: Client, secret: &str)
ID_DOMAIN + "/oauth2/token";
let mut params = BTreeMap::new();
- params.insert("client_id".to_owned(), client.id().to_owned());
- params.insert("client_secret".to_owned(), secret.to_owned());
- params.insert("grant_type".to_owned(), "client_credentials".to_owned());
- params.insert("scope".to_owned(), "".to_owned());
+ params.insert("client_id", client.id());
+ params.insert("client_secret", secret);
+ params.insert("grant_type", "client_credentials");
+ params.insert("scope", "");
- ApiRequest::new(url, params, client, Method::POST, None)
+ ApiRequest::new(url, params, client.clone(), Method::POST, None)
}