diff --git a/src/components/shortcodes/ProtectedContent.astro b/src/components/shortcodes/ProtectedContent.astro index b6c384a..1ab737d 100644 --- a/src/components/shortcodes/ProtectedContent.astro +++ b/src/components/shortcodes/ProtectedContent.astro @@ -9,7 +9,7 @@ interface Props { const { password: propPassword, pwEnv } = Astro.props; // Get password from props, environment variable, or site config -const password = (pwEnv ? import.meta.env[pwEnv] : propPassword) || siteConfig.contentPassword || import.meta.env.CONTENT_PASSWORD; +const password = (pwEnv ? import.meta.env[pwEnv] : propPassword) || siteConfig.contentPassword || import.meta.env.CONTENT_PASSWORD || Math.random().toString(); // Get the slot content const content = await Astro.slots.render('default'); @@ -21,30 +21,28 @@ const { encryptedData, iv } = encrypt(content, password);

This content is protected. Enter the password to view it:

-
+
-
+