aboutsummaryrefslogtreecommitdiffstats
path: root/teleterm
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2019-12-07 13:42:23 -0500
committerJesse Luehrs <doy@tozt.net>2019-12-07 13:42:23 -0500
commit8776aa9a5b400f194b3d6eb57808eaf775e9fc5a (patch)
tree27cd263c7137bc4d51bc8f4ad4658a16bbfca34a /teleterm
parent3c41decaed01ea8d556766b519e90586c49b48ac (diff)
downloadteleterm-8776aa9a5b400f194b3d6eb57808eaf775e9fc5a.tar.gz
teleterm-8776aa9a5b400f194b3d6eb57808eaf775e9fc5a.zip
bump oauth2
Diffstat (limited to 'teleterm')
-rw-r--r--teleterm/Cargo.toml2
-rw-r--r--teleterm/src/oauth.rs14
2 files changed, 9 insertions, 7 deletions
diff --git a/teleterm/Cargo.toml b/teleterm/Cargo.toml
index 381be01..bc2c020 100644
--- a/teleterm/Cargo.toml
+++ b/teleterm/Cargo.toml
@@ -31,7 +31,7 @@ lazy-static-include = "2"
log = { version = "0.4", features = ["release_max_level_info"] }
mio = "0.6.19"
native-tls = "0.2"
-oauth2 = "=3.0.0-alpha.4" # need the alpha for async support
+oauth2 = { version = "=3.0.0-alpha.6", features = ["futures-01"] } # need the alpha for async support
open = "1.1"
rand = "0.7"
ratelimit_meter = "5"
diff --git a/teleterm/src/oauth.rs b/teleterm/src/oauth.rs
index 894ba1d..ee914b4 100644
--- a/teleterm/src/oauth.rs
+++ b/teleterm/src/oauth.rs
@@ -37,7 +37,7 @@ pub trait Oauth {
let fut = self
.client()
.exchange_code(oauth2::AuthorizationCode::new(code.to_string()))
- .request_async(oauth2::reqwest::async_http_client)
+ .request_future(oauth2::reqwest::future_http_client)
.map_err(|e| {
let msg = stringify_oauth2_http_error(&e);
Error::ExchangeCode { msg }
@@ -59,7 +59,7 @@ pub trait Oauth {
.exchange_refresh_token(&oauth2::RefreshToken::new(
token.to_string(),
))
- .request_async(oauth2::reqwest::async_http_client)
+ .request_future(oauth2::reqwest::future_http_client)
.map_err(|e| {
let msg = stringify_oauth2_http_error(&e);
Error::ExchangeRefreshToken { msg }
@@ -153,10 +153,12 @@ impl Config {
oauth2::basic::BasicClient::new(
oauth2::ClientId::new(self.client_id),
Some(oauth2::ClientSecret::new(self.client_secret)),
- oauth2::AuthUrl::new(self.auth_url),
- Some(oauth2::TokenUrl::new(self.token_url)),
+ oauth2::AuthUrl::new(self.auth_url.to_string()).unwrap(),
+ Some(oauth2::TokenUrl::new(self.token_url.to_string()).unwrap()),
+ )
+ .set_redirect_url(
+ oauth2::RedirectUrl::new(self.redirect_url.to_string()).unwrap(),
)
- .set_redirect_url(oauth2::RedirectUrl::new(self.redirect_url))
}
}
@@ -164,7 +166,7 @@ impl Config {
// stringification is pretty useless
fn stringify_oauth2_http_error(
e: &oauth2::RequestTokenError<
- oauth2::reqwest::Error,
+ oauth2::reqwest::Error<reqwest::Error>,
oauth2::StandardErrorResponse<oauth2::basic::BasicErrorResponseType>,
>,
) -> String {