Remove support for password in environment variable.

This is less useful now that saved credentials work.
This commit is contained in:
Paul Lietar 2016-04-24 09:56:05 +01:00
parent f8cd09e5be
commit c47a1b7ec9

View file

@ -21,8 +21,6 @@ use librespot::session::{Bitrate, Config, Session};
use librespot::spirc::SpircManager;
use librespot::version;
static PASSWORD_ENV_NAME: &'static str = "SPOTIFY_PASSWORD";
fn usage(program: &str, opts: &getopts::Options) -> String {
let brief = format!("Usage: {} [options]", program);
format!("{}", opts.usage(&brief))
@ -133,7 +131,6 @@ fn main() {
let credentials = username.map(|username| {
let password = matches.opt_str("p")
.or_else(|| std::env::var(PASSWORD_ENV_NAME).ok())
.unwrap_or_else(|| {
print!("Password: ");
stdout().flush().unwrap();
@ -158,8 +155,6 @@ fn main() {
}
}).expect("No username provided and no stored credentials.");
std::env::remove_var(PASSWORD_ENV_NAME);
let reusable_credentials = session.login(credentials).unwrap();
session.cache().put_credentials(&reusable_credentials);