don't read patreon creds from envvars
Signed-off-by: Xe Iaso <me@christine.website>
This commit is contained in:
parent
3a5c7adc42
commit
fa2ada9747
|
@ -124,8 +124,8 @@ pub struct Links {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Client {
|
impl Client {
|
||||||
pub fn new(creds: Credentials) -> Result<Self> {
|
pub fn new() -> Result<Self> {
|
||||||
let mut creds = creds.clone();
|
let mut creds = Credentials::default();
|
||||||
|
|
||||||
let p = Path::new(".patreon.json");
|
let p = Path::new(".patreon.json");
|
||||||
if p.exists() {
|
if p.exists() {
|
||||||
|
|
|
@ -18,16 +18,7 @@ pub struct Config {
|
||||||
|
|
||||||
#[instrument]
|
#[instrument]
|
||||||
async fn patrons() -> Result<Option<patreon::Users>> {
|
async fn patrons() -> Result<Option<patreon::Users>> {
|
||||||
use patreon::*;
|
let mut cli = patreon::Client::new()?;
|
||||||
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)?;
|
|
||||||
|
|
||||||
cli.refresh_token().await?;
|
cli.refresh_token().await?;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue