fix: correct yup-oauth2 types (Authenticator, AccessToken, ApplicationSecret fields)
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
use reqwest::Client;
|
||||
use yup_oauth2::{InstalledFlowAuthenticator, InstalledFlowReturnMethod, ApplicationSecret};
|
||||
use yup_oauth2::{
|
||||
authenticator::Authenticator, hyper::client::connect::HttpConnector,
|
||||
hyper_rustls::HttpsConnector, ApplicationSecret, InstalledFlowAuthenticator,
|
||||
InstalledFlowReturnMethod,
|
||||
};
|
||||
|
||||
use crate::domain::models::*;
|
||||
|
||||
@@ -26,7 +30,7 @@ impl std::error::Error for ApiError {}
|
||||
|
||||
pub struct ApiClient {
|
||||
client: Client,
|
||||
authenticator: InstalledFlowAuthenticator,
|
||||
authenticator: Authenticator<HttpsConnector<HttpConnector>>,
|
||||
token_path: PathBuf,
|
||||
}
|
||||
|
||||
@@ -49,9 +53,9 @@ impl ApiClient {
|
||||
auth_uri: "https://accounts.google.com/o/oauth2/v2/auth".to_string(),
|
||||
token_uri: "https://oauth2.googleapis.com/token".to_string(),
|
||||
redirect_uris: vec!["http://127.0.0.1:8080/".to_string()],
|
||||
client_email: String::new(),
|
||||
client_x509_cert_url: String::new(),
|
||||
project_id: String::new(),
|
||||
client_email: None,
|
||||
client_x509_cert_url: None,
|
||||
project_id: None,
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
@@ -88,7 +92,7 @@ impl ApiClient {
|
||||
.token(SCOPES)
|
||||
.await
|
||||
.map_err(|e| ApiError::Auth(format!("Token error: {}", e)))?;
|
||||
Ok(token.as_str().to_string())
|
||||
Ok(token.token().unwrap_or("").to_string())
|
||||
}
|
||||
|
||||
pub async fn fetch_lists(&self) -> Result<Vec<TaskList>, ApiError> {
|
||||
|
||||
Reference in New Issue
Block a user