How to secure gated content on a website when JavaScript is disabled while using Memberstack DOM package? Answered
I having some difficulty, I'm trying gated content on my plain html/js site. I've added this:
import memberstackDOM from '@memberstack/dom';
const memberstack = memberstackDOM.init({
publicKey: "123456789",
});
and then "data-ms-content="members"" to my page element but it still shows. Am I misunderstanding somthing?
Comments
6 comments
I fixed this using "Memberstack.js" from here https://docs.memberstack.com/hc/en-us/articles/11217223809819-Vanilla-JS-Guide
Thank you for sharing the solution 🙏
All good mate!
Hi all, I am busy building a employment website / platform, it needs to have gated content. So that workseekers and companies can apply, add a payment plan and register / login.
Does the gated content keeps hidden when Javascript is disabled by the user? Because if its rendered in the html you could acces it? Or am i misunderstanding something? Is doing ti by API a option or is there no problem, anyway?
Maybe i can load the content with javascript, should solve it, right?
Or should i use the DOM package available?
Or maybe nothing extra is needed as when javascript is disabled, it will stop working.
What do you suggest?
Hi Patrick,
When using Memberstack for gated content, the content is typically protected through JavaScript. This means that if a user has JavaScript disabled, they aren't supposed to access the gated content as intended. However, if the content is rendered in the HTML without proper protection, it could potentially be accessed by users who disable JavaScript.
We came up with some steps to add further security to your website in this article.
I hope this helps.
Thanks for the reply, ill look into this!!
Please sign in to leave a comment.