Skip to content

Commit

Permalink
add no-cache to secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
guitavano committed Mar 3, 2025
1 parent d52fc02 commit 59777af
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions website/loaders/secret.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface Props {
*/
name?: string;
}
const cache: Record<string, Promise<string | null>> = {};

const showWarningOnce = once(() => {
console.warn(
colors.brightYellow(
Expand All @@ -47,7 +47,7 @@ const getSecret = async (props: Props): Promise<string | null> => {
await showWarningOnce();
return Promise.resolve(null);
}
return cache[encrypted] ??= decryptFromHex(encrypted).then((d) => d.decrypted)
return decryptFromHex(encrypted).then((d) => d.decrypted)
.catch((err) => {
const prettyName = name ? colors.brightRed(name) : "anonymous secret";
console.error(
Expand All @@ -67,3 +67,5 @@ export default async function Secret(props: Props): Promise<Secret> {
},
};
}

export const cache = "no-cache";

0 comments on commit 59777af

Please sign in to comment.