don't read patreon creds from envvars

Signed-off-by: Xe Iaso <me@christine.website>
This commit is contained in:
Cadey Ratio 2022-04-05 20:35:07 -04:00
parent 3a5c7adc42
commit fa2ada9747
2 changed files with 3 additions and 12 deletions

View File

@ -124,8 +124,8 @@ pub struct Links {
}
impl Client {
pub fn new(creds: Credentials) -> Result<Self> {
let mut creds = creds.clone();
pub fn new() -> Result<Self> {
let mut creds = Credentials::default();
let p = Path::new(".patreon.json");
if p.exists() {

View File

@ -18,16 +18,7 @@ pub struct Config {
#[instrument]
async fn patrons() -> Result<Option<patreon::Users>> {
use patreon::*;
let creds: Credentials = envy::prefixed("PATREON_")
.from_env()
.unwrap_or(Credentials::default());
if creds == Credentials::default() {
return Ok(None);
}
let mut cli = Client::new(creds)?;
let mut cli = patreon::Client::new()?;
cli.refresh_token().await?;