mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
Remove support for password in environment variable.
This is less useful now that saved credentials work.
This commit is contained in:
parent
f8cd09e5be
commit
c47a1b7ec9
1 changed files with 0 additions and 5 deletions
|
@ -21,8 +21,6 @@ use librespot::session::{Bitrate, Config, Session};
|
||||||
use librespot::spirc::SpircManager;
|
use librespot::spirc::SpircManager;
|
||||||
use librespot::version;
|
use librespot::version;
|
||||||
|
|
||||||
static PASSWORD_ENV_NAME: &'static str = "SPOTIFY_PASSWORD";
|
|
||||||
|
|
||||||
fn usage(program: &str, opts: &getopts::Options) -> String {
|
fn usage(program: &str, opts: &getopts::Options) -> String {
|
||||||
let brief = format!("Usage: {} [options]", program);
|
let brief = format!("Usage: {} [options]", program);
|
||||||
format!("{}", opts.usage(&brief))
|
format!("{}", opts.usage(&brief))
|
||||||
|
@ -133,7 +131,6 @@ fn main() {
|
||||||
|
|
||||||
let credentials = username.map(|username| {
|
let credentials = username.map(|username| {
|
||||||
let password = matches.opt_str("p")
|
let password = matches.opt_str("p")
|
||||||
.or_else(|| std::env::var(PASSWORD_ENV_NAME).ok())
|
|
||||||
.unwrap_or_else(|| {
|
.unwrap_or_else(|| {
|
||||||
print!("Password: ");
|
print!("Password: ");
|
||||||
stdout().flush().unwrap();
|
stdout().flush().unwrap();
|
||||||
|
@ -158,8 +155,6 @@ fn main() {
|
||||||
}
|
}
|
||||||
}).expect("No username provided and no stored credentials.");
|
}).expect("No username provided and no stored credentials.");
|
||||||
|
|
||||||
std::env::remove_var(PASSWORD_ENV_NAME);
|
|
||||||
|
|
||||||
let reusable_credentials = session.login(credentials).unwrap();
|
let reusable_credentials = session.login(credentials).unwrap();
|
||||||
session.cache().put_credentials(&reusable_credentials);
|
session.cache().put_credentials(&reusable_credentials);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue