/// Transform existing credentials into token credentials
Transform existing credentials into token credentials
Transform existing credentials into token credentials
pub fn change_to_token_credentials(
    credentials: Credentials,
) -> Result<Credentials, Box<dyn std::error::Error>> {
    let username = credentials.username.clone();
    // By default, use the clientID of the official Spotify client
    let token = get_token(credentials, "65b708073fc0480ea92a077233ca87bd", "streaming")?;
    Ok(Credentials {
        username,
        auth_type: AuthenticationType::AUTHENTICATION_SPOTIFY_TOKEN,
        auth_data: token.as_bytes().into(),
    })
}
pub fn change_to_token_credentials ( credentials : Credentials , ) -> Result < Credentials , Box < dyn std :: error :: Error > > { let username = credentials . username . clone ( ) ; // By default, use the clientID of the official Spotify client let token = get_token ( credentials , " " , " " ) ? ; Ok ( Credentials { username , auth_type : AuthenticationType :: AUTHENTICATION_SPOTIFY_TOKEN , auth_data : token . as_bytes ( ) . into ( ) , } ) }
Transform existing credentials into token credentials
Transform existing credentials into token credentials
credentials
Credentials