From 8776aa9a5b400f194b3d6eb57808eaf775e9fc5a Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 7 Dec 2019 13:42:23 -0500 Subject: bump oauth2 --- teleterm/Cargo.toml | 2 +- teleterm/src/oauth.rs | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'teleterm') 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, oauth2::StandardErrorResponse, >, ) -> String { -- cgit v1.2.3-54-g00ecf