[−][src]Function mojang_api::client_login
pub async fn client_login<'_, '_>(
username: &'_ str,
password: &'_ str
) -> Result<ClientLoginResponse>
Authenticates a user, returning a client access token and metadata for the user.
The returned access token can later be used with client_auth
to log in to a server.
Examples
let response: mojang_api::ClientLoginResponse = mojang_api::client_login("username", "password").await?; println!("Access token: {}", response.access_token); println!("User email: {}", response.user.email);