Streaming live at 10am (PST)

Password protection – work around for collection pages


#1

The client's asked me to password protect a small section of a site, but that's to include a staff news blog. So, now I'm stuck since password protection isn't available for dynamic pages.

I'd like to pick your brains: Is there any work-around at all adding Custom Code to the collection page template?

It seems that WF places a cookie named 'wf_auth_page'

I was thinking like so:

  1. Javascript to check whether wf_auth_page cookie exists
  2. If yes, do nothing
  3. If no, re-direct to URL (landing page of protected section, which would bing up the password page)

I would use or robots.txt to prevent search engines listing it – and perhaps interactions to prevent content showing up before the cookie check has taken place.

Perhaps all not perfect, but this would seem like a reasonable work-around to me. Trouble is that I can't do Javascript, so would be hoping for some help here (and maybe this then also helps others).

Thank you!


#2

Very basic password protection:

<script>
var password = "letmein";
if(prompt("Enter password:", "") !== password) window.location = "/";
</script>

Paste this in Page Settings > Header Code.


#3

Thank you for your reply @samliew. But this isn't what I was asking about. I need to protect a collection page AS PART OF other static pages that are protected – i.e. no new/different password to be entered, but the collection pages should be visible to those who have are logged on with all others to be re-directed.


#4

In that case, please vote for this wishlist item https://wishlist.webflow.com/ideas/WEBFLOW-I-270

There is no workaround as this is implemented server-side.


#5

I would but I haven't got any votes left.