Skip to main content

client_login

Function client_login 

Source
pub async fn client_login(
    username: &str,
    password: &str,
) -> Result<ClientLoginResponse>
Expand description

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);