Hi! I want to pwd-protect my Page. How to do it with Functions?
I have a static page set up, live, working. I want to add password protection to the page. I found a TypeScript-based solution here: https://dev.to/charca/password-protection-for-cloudflare-pages-8ma It has four TypeScript files that it places in the /functions folder to create the login middleware. I added the /functions folder and files to my working folder, added the password variable to my "Environment variables" in Workers & Pages -> [My Page] -> Settings -> Environment variables, and redeployed the page. The password protection feature isn't working. I do not know why.
I am completely without a clue as to what I am doing. I don't understand the distinction between Workers and Pages, or what Wranglers, Binders, or Playgrounds are. The CloudFlare manual documentation seems to assume I know the differences between these things and what their various purposes are before it teaches me how to use them all. Please help me.
DEV Community
Password Protection for Cloudflare Pages
Cloudflare Pages is a fantastic service for hosting static sites: it is extremely easy to set-up, it...
0 Replies