Skip to content

Commit

Permalink
fix: 🐛 fallback to file store, if keytar is unavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
joaomoreno committed Jan 27, 2022
1 parent d18e59c commit a332618
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,16 @@ async function openDefaultStore(): Promise<IStore> {
return await FileStore.open();
}

const keytarStore = await KeytarStore.open();
let keytarStore: IStore;

try {
keytarStore = await KeytarStore.open();
} catch (err) {
const store = await FileStore.open();
log.warn(`Failed to open credential store. Falling back to storing secrets clear-text in: ${store.path}`);
return store;
}

const fileStore = await FileStore.open();

// migrate from file store
Expand Down

0 comments on commit a332618

Please sign in to comment.