How would I password protect a public page?


The app I’m working on has a login for internal users for my business. However, I want one page to act as a public page for my wholesale clients, i.e. doesn’t require a login. I do want to have that page password protected though, with a common password that I’m going to share with all my wholesale clients. The idea is that they’ll go to this public page, enter a common password (that each of them will have, and is the same for everyone), to be redirected to a set of additional public pages that one can only get to through a password. These clients aren’t going to be registered users of the app, i.e. they will not have records/entries in the Users table (that will only be for my internal business team).

I’m not sure how I would approach this. Any help would be much appreciated.

Thank you.

Hey @SeanB

Thanks for the post and cool idea.

As with most things in Bubble, there are probably a couple of ways you could tackle this. I’m assuming since this is a generic password that will be shared with clients, this isn’t a hyper secure page, so, my suggestion will fit with that suggestion.

Even when a user is logged out, you can temporarily use a user record with them in the same way you can write changes to the ‘current user’. So, one approach would be to have a landing page with an input. When they enter the password and click enter, you could store the value they entered in their user record and redirect them. On the protected page, you could have conditions that either show a message about the password not being correct, or show the content of the page based on if the user’s value is right or not.

You could do something similar with parameters where you redirect them to the page with what they entered as a parameter. If it’s right, things display as expected. If not, there’s an error message, or they’re redirected.

Does this help? If this kicks up any additional questions, feel free to reach out to us directly at [email protected]

1 Like

Thanks a bunch for this @AndrewV I think I understood this approach and have sent an email to [email protected] just to clarify my understanding. Appreciate the guidance here, thanks once again.