How to prevent gated content from briefly displaying before redirect using JavaScript security?

Post author
Jake Taplin

Hi everyone, When I go to the gated content section of my website without the permissions, it loads for a second, then gets redirected to the access denied page. During that loading time the content appears on stream and its possible to access the webtools and download the files. How do I stop this? I tried putting the ms-code-delay on my wrapper but it doesn't seem to do anything

I implemented some JavaScript to stop the page from displaying until it has been verified. But I didn't realize that this content is still wide open for someone who knows how to use Dev tools.

Comments

3 comments

  • Comment author
    A J

    Hey Jake Taplin, do you think Hosted Content feature could help you out in securing the downloadable files a bit more for your use-case?

    0
  • Comment author
    Jake Taplin

    Thanks A J, this is interesting. I'm not sure it will work since my course is a CMS page, and the embed HTML for the video gets brought in from the CMS for each part of the course (35 parts). If I understand this correctly, this would only work for a static element.

    0
  • Comment author
    A J

    Oh I see Jake Taplin, just wondering why don't you use data-ms-content attribute additionally to gate the video elements or any element on the page which you don't want users to access based on the plan they are assigned. And also keep such video element hidden by default and add this data-ms-bind:style="display:block" custom attribute to it. So essentially, the crucial elements are hidden already and when Memberstack loads, it checks whether the user definitely has permission to such element and then displays it.

    Here's a guide on the use of such sytle based custom attribute. Does this help your use-case?

    0

Please sign in to leave a comment.