Advice on Password protected page access

Hi all,

Wondering if anyone can help add some logic to my brain here.

I have created an action where if a user choses yes, they gate their page.

It works well and no issues with on and off.

But what I would like to do now is allow users who enter a “key” or “password” to be able to see the gated content.

I don’t want to use external plugins for this.

I have created a database thing for User - User-Gate-Key which they can update and change as per make changes to user etc.

How do I allow it for users to enter this “key” and get access to the content on those pages?

I have a popup that shows on Gated page load saying “Gated Content, enter password to view”

Now I need to logic to make an input open the page.

Hope what I have written helps with understanding the flow.

Any help appreciated.

Hello,

IYou need to generate a random key as a string and store it in the database.

Screenshot from 2023-08-29 16-27-34

Screenshot from 2023-08-29 16-28-22

Screenshot from 2023-08-29 16-32-10

on page load, show a group to enter a key. When users enter the key and hit the button submit then Do a Search for Gate content and match the input value from the database. If matches hide the authentication key group if not then display an error alert.

If you are planning for a one time use only key then add an additional action to delete the key from the database after it matches.

Superstar. Thank you

Happy to help!

1 Like

Make sure to apply privacy rules properly in order not to disclose this field to anyone.

1 Like

Thanks

This topic was automatically closed after 70 days. New replies are no longer allowed.