feat: improved configuration (#31)

This commit is contained in:
Morten Olsen
2024-01-14 12:49:54 +01:00
committed by GitHub
parent 2109bc3af9
commit 7436b3439c
14 changed files with 42 additions and 28 deletions

View File

@@ -20,10 +20,10 @@ class Auth {
#setup = async () => {
const { config } = this.#options;
const secretLocation = resolve(config.files.location, 'secret');
const secretLocation = resolve(config.files.data, 'secret');
let secret = '';
await mkdir(config.files.data, { recursive: true });
if (!existsSync(secretLocation)) {
await mkdir(config.files.location, { recursive: true });
secret = nanoid();
await writeFile(secretLocation, secret);
} else {