aboutsummaryrefslogtreecommitdiffstats
path: root/teleterm/src/oauth.rs
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/src/oauth.rs
parent3c41decaed01ea8d556766b519e90586c49b48ac (diff)
downloadteleterm-8776aa9a5b400f194b3d6eb57808eaf775e9fc5a.tar.gz
teleterm-8776aa9a5b400f194b3d6eb57808eaf775e9fc5a.zip
bump oauth2
Diffstat (limited to 'teleterm/src/oauth.rs')
-rw-r--r--teleterm/src/oauth.rs14
1 files changed, 8 insertions, 6 deletions
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 {