allow SimpleFIN credentials via ENV

This commit is contained in:
Robert Dyer
2024-08-11 20:53:54 -05:00
parent 78b61ec76e
commit 7fe986c429
2 changed files with 11 additions and 0 deletions
+5
View File
@@ -6,6 +6,10 @@ require("dotenv").config();
const getCredentials = async () => {
if (process.env.SIMPLEFIN_CREDENTIALS) {
return process.env.SIMPLEFIN_CREDENTIALS;
}
const token = readline.question('Enter your SimpleFIN setup token: ');
const url = atob(token.trim());
@@ -19,6 +23,7 @@ const getCredentials = async () => {
const data = `${username}:${pw}`;
fs.writeFileSync('simplefin.credentials', data);
console.log('SimpleFIN credentials:', data);
return data;
};