pub(crate) trait MiddlewareExt:
'static
+ Send
+ Sync {
// Required method
fn get_token<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, LoginError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Trait used to share over the token attaching middleware. This is implemented by the token management structs, leaving them responsible for handling token retrieval and renewal logic. The middleware simply calls MiddlewareExt::get_token to get the current token (renewing if necessary) and attaches it to the request.