get_auth_token

Function get_auth_token 

Source
pub async fn get_auth_token(
    instance_domain: &str,
    authorization_code: &str,
    registered_app: &RegisteredApp,
    app: &AppInfo,
) -> Result<TokenResponse, Error>
Expand description

Obtain an access token from an instance using an authorization code. The registered_app and app need to be matching.

§Errors

This method fails if there was an issue connecting to the instance, or if the authorization failed.

§Example

let account = auth::verify_credentials("mastodon.art", "[TOKEN]").await?;