Skip to main content
โ† Resources & Tips
Resources & Tips September 14, 2024 ยท 3 replies

Hi ๐Ÿ˜ƒ Need to set access to a page, or set of pages, based on a code without having aโ€ฆ

Archived from the Bravo community forum (2021โ€“2026). Some answers may refer to older versions of Bravo.

Hi ๐Ÿ˜ƒ Need to set access to a page, or set of pages, based on a code without having a login functionality in the app. How do I do this?

3 replies

Valter September 14, 2024

Bravo have a sample app for that but the sample app uses age. You jylust have to adapt

Alex September 25, 2024

Yeah its not too hard, you can do that. Or if you use Xano as your backend you can set pages to private or public.

You basically need a conditional that checks if your user has access to that page (based on a backend toggle). And that user ID could be done from Device.id or UUID

trudi November 30, 2024

To set access to a page based on a code without a login system:

  1. Create an Access Code: Generate a unique code (e.g., password or token).

  2. Store the Code: Save it securely (e.g., in a config file or database).

  3. Check the Code: When a user visits the page, prompt them for the code. If the entered code matches, grant access.

Example (PHP):

$access_code = "mySecretCode";
if ($_POST['access_code'] == $access_code) {
    echo "Access granted!";
} else {
    echo "Access denied.";
}

This method allows access control without a full login system.

Wrote something in this thread and want it removed? Request removal

Still stuck?

Ask the community on Discord

This archive is read-only. New questions, office hours and product updates now happen in the Bravo Discord.

Join the Discord