SOLVED (by me): Unique password-protection on individual CMS items!

Scoured the forum for help with this as I’m trying to send clients proposals as CMS pages, but each item would need its own password unique to the client (which Webflow doesn’t offer yet).

I found some code on a forum post a while ago (unfortunately I can’t find the post so I can’t credit the author yet) that goes like this:

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

It’s not a full password page but it works as a little popup.

So I created a “Proposals” collection with a reference field to another collection called “Passwords.”

Add the above code to inside the header of the Collection Page Template (in this case, “Proposals”), and click Add Field. Replace the word “password” (in var password= “password”) with the reference field to a Password Code field in the Passwords collection. It’ll automatically link each custom password to each particular collection page to which they apply!

Let me know how this works for you!

1 Like

Just so you know, you probably shouldn’t use this method if the password is intended for restricting access to sensitive / confidential information because it stays accessible by consulting the page’s source code or opening your browser’s inspector.

[EDIT] Right click is disabled by the prompt, but you can still access through your brower’s menu to show source code and / or inspector

Interesting; Developer Tools aren’t opening in Chrome. I’ll try in other browsers. Thanks!

Any workarounds you suggest?

It does in chrome :wink: if you go to source code (supposing you guessed the prompt is in the head)
Here’s a screenshot :

But I agree, this means the user clearly knows what (s)he’s doing and searching for. If you change the var 's name to linkedCollection for instance, it makes it a bit longer to find the password (but not that long :slight_smile: ).

Yea…you don’t want to do that. Anyone can read what the password is by viewing the source. Instead use something like MemberStack. If you don’t want to use them, then use Integromat and store those password within their Datastore. Perform the check there instead.

Sorry to dig this up again, but has anyone had any luck with the Integromat solution Chris mentioned that they would be willing to share? I’ve tried Integromat out a little and it works really well, especially when it comes to updating live Webflow CMS items. If someone with a little more coding knowledge could walk us through this, I’m sure quite a few Webflow users would appreciate the solution!

Is there a reason not to use an existing service like Memberspace or MemberStack to help with this? It would be SUPER tricky to create your own solution (though doable) and would save you a bunch of time and pain using something that already has this solved.

Fair enough… It looked like Memberstack was missing a couple features that I needed but it may be better to start there and then see what workarounds are possible with services like Zapier or Integromat if needed. It does make the monthly fees add up for my client but I suppose it’s worth it for things to run smoothly.

1 Like

I’ve been using the one-two combo of Webflow + MemberStack for awhile and it’s been working well (requiring Zapier or Integromat of course). I’ve got a ton of video screencasts that walk through various setups with both at https://nocodequest.com maybe that’ll help with some of their missing features?

This is fantastic, thanks for sharing! I’ll take some time to dig through this but I’m sure it will help.

1 Like

@BrandShine_Creative Would you mind explaining this in a bit more detail?

I don’t need these password protected pages to be that secure, just something basic like the above will work, really just a simple pop-up that I ask users to get around would be what I need.

With the code listed at the top of the page, would I just make a div that, for example, changes the css to “display : none” upon the user entering in the correct password? Could anyone help me out a bit with this?

Thanks!

_Winston