Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2025-04-15 14:51:48 +01:00
parent 221ed97062
commit 4826d52465
No known key found for this signature in database
GPG Key ID: A2B008A5F49F5D0D

View File

@ -44,14 +44,19 @@ async function getOrCreatePassphrase(key: string): Promise<string> {
const storedPassphrase = await store.getSecret(key);
if (storedPassphrase !== null) {
return storedPassphrase;
} else {
}
} catch (e) {
console.error("Error getting the event index passphrase out of the secret store", e);
}
try {
const newPassphrase = await randomArray(32);
await store.setSecret(key, newPassphrase);
return newPassphrase;
}
} catch (e) {
console.log("Error getting the event index passphrase out of the secret store", e);
console.error("Error creating new event index passphrase, using default", e);
}
return seshatDefaultPassphrase;
}