Merge pull request #97 from joshka/page_auth
fix: authenticate in page_next/page_prev calls
This commit is contained in:
commit
1cb3b834cf
|
@ -381,7 +381,7 @@ impl Mastodon {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Set the bearer authentication token
|
/// Set the bearer authentication token
|
||||||
fn authenticated(&self, request: RequestBuilder) -> RequestBuilder {
|
pub(crate) fn authenticated(&self, request: RequestBuilder) -> RequestBuilder {
|
||||||
request.bearer_auth(&self.data.token)
|
request.bearer_auth(&self.data.token)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ macro_rules! pages {
|
||||||
"making API request"
|
"making API request"
|
||||||
);
|
);
|
||||||
let url: String = url.into(); // <- for logging
|
let url: String = url.into(); // <- for logging
|
||||||
let response = self.mastodon.client.get(&url).send().await?;
|
let response = self.mastodon.authenticated(self.mastodon.client.get(&url)).send().await?;
|
||||||
match response.error_for_status() {
|
match response.error_for_status() {
|
||||||
Ok(response) => {
|
Ok(response) => {
|
||||||
let (prev, next) = get_links(&response, self.call_id)?;
|
let (prev, next) = get_links(&response, self.call_id)?;
|
||||||
|
|
Loading…
Reference in New Issue