Fix tests and examples to use token() method on AccessToken

This commit is contained in:
Brandon Ogle
2022-10-10 12:46:23 -07:00
parent 818d1c2eea
commit db8dd7d68d
2 changed files with 18 additions and 18 deletions

View File

@@ -22,11 +22,11 @@ where
S::Future: Send + Unpin + 'static,
S::Error: Into<Box<dyn StdError + Send + Sync>>,
{
let token = authenticator.token(&["email"]).await?;
let access_token = authenticator.token(&["email"]).await?;
let request = http::Request::get("https://example.com")
.header(
http::header::AUTHORIZATION,
format!("Bearer {}", token.access_token().ok_or("no access token")?),
format!("Bearer {}", access_token.token().ok_or("no access token")?),
)
.body(hyper::body::Body::empty())?;
let response = client.request(request).await?;