charca / cloudflare-pages-auth Goto Github PK
View Code? Open in Web Editor NEWBasic Authentication for Cloudflare Pages
License: MIT License
Basic Authentication for Cloudflare Pages
License: MIT License
Hi !
I was wondering if there is a way in the constants file to not choose the path we don't need to protect, but the page we DO need to protect.
I only have the pages with something like /protected/ in the URL.
Or maybe you have a way to do that in another way ?
Thanks !
First, thank you very much for your work - this kind of password protection is really handy for most cases.
I used the vite-plugin-pwa
to make my Vue App as PWA installable. That works locally really well.
But deployed on CF the web.manifest cannot be found correctly, because the new html section is injected and first shows the password prompt.
I already tried to copy the original html head into the injected one, but it does not seem to work.
Is there any way to accomplish this or do the two things (your auth and the pwa functionality) do not work together this way?
This is the PWA plugin I used: https://vite-pwa-org.netlify.app/guide/
New to this - I simply forked the repo, created a pages instance, set the CFP_PASSWORD and thought it should work - what is the Pages configuration or is there something else that should be done?
Hi, thanks for making this. This is exactly what I was looking for, but I can't make it work. I copied functions folder into root of my site and uploaded zip to cloudflare. I added CFP_PASSWORD into pages environment variable. I tried encrypted an clear text passwords. I tried every posible combination i could think of but I simply can not get login page on my site. Can you give me any hint what else I can try.Thanks.
Hi, I've noticed it's possible to bypass the login page and to see the page index without authenticating by adding /cfp_login
to the url to access the route directly. Is there any possible fix for this? Thanks!
I'd like to be able to send a URL like https://some.pages.dev?auth=password which lets the user bypass the login screen. This feature would help remove some friction when I have a gnarly randomly generated password.
Hello,
Thank you for your article and this code. I'm having a bit of a trouble getting it to work though. I'm using SvelteKit with the cloudflare adapter and I experience the following behaviour:
My svelte.config.js
looks like this:
import adapter from '@sveltejs/adapter-cloudflare';
import preprocess from 'svelte-preprocess';
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: preprocess(),
kit: {
adapter: adapter({
platform: 'node'
}),
// hydrate the <div id="svelte"> element in src/app.html
target: '#svelte'
}
};
export default config;
Could this issue and explanation be related somehow?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.