mirror of
https://github.com/OMGeeky/yup-oauth2.git
synced 2026-02-23 15:50:00 +01:00
Fix tests and examples to use token() method on AccessToken
This commit is contained in:
@@ -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?;
|
||||
|
||||
Reference in New Issue
Block a user