I am building my own portfolio and I was looking for a way that I could have some of my pages(case studies) locked behind a static password like 1234 and then store that in the browser's cookies. how can I do that with Astro template?
Layout.astro:
---
import Basehead from "../components/Basehead.astro";
import { SITE_DESCRIPTION,SITE_TITLE } from '../consts';
const {frontmatter} = Astro.props;
---
<html>
<head>
<Basehead title={SITE_TITLE} description={SITE_DESCRIPTION}></Basehead>
</head>
<h1>{frontmatter.title}</h1>
<p>{frontmatter.description}</p>
<img src={frontmatter.cover} height="200" width="200" alt="" >
<article>
<slot /> <!-- Markdown content is injected here -->
</article>
</html>
Page.mdx:
My case study is here and I want to prompt users to enter the password if the password: true
---
layout: ../layouts/CaseStudyLayout.astro
title: case study post
description: the description
cover: https://framerusercontent.com/images/D5baHWHk2hVJyc1znehFavwU1I.jpeg
password: true
---
import Video from '../components/Video.astro'
export const title = 'My first MDX post'
## Background
This Markdown file creates a page at `your-domain.com/page-1/`
<Video />