User accounts & login

How to make a page visible only to signed-in users

How to make a page visible only to signed-in users

In TeleportHQ, you make a page members-only with Require Authentication. In the editor, open the page's menu in the Pages list (or Page settings → Security) and turn on Require Authentication. On your published site, visitors who aren't signed in are sent to the sign-in page. To limit the page to a role, such as editor, set Role Protection. In an online store, Subscriber Access keeps a page for customers with an active subscription. Publish your site for the change to take effect.

Before you start

Steps

Require sign-in

  1. In the left sidebar, click Pages, Components & Tree View.
  2. Find the page you want to protect, for example dashboard. Right-click it, or click the … button at the end of its row.
  3. Turn on the Require Authentication switch.

A lock icon appears on the page row, with the tooltip "Requires authentication".

A page's menu in the TeleportHQ Pages list with the Require Authentication switch turned on and Role Protection below it

You can also do it from the page itself: open the page, click Page settings above the top right of the canvas, open the Security tab and use the same switch under Authentication. "Visitors must sign in to open this page. Pick roles to narrow it further."

The Security tab of TeleportHQ Page settings, with the Require Authentication switch and Role Protection under Authentication

Limit the page to a role (optional)

  1. In the same menu, point at Role Protection (it shows Any until you pick a role). The Select Role panel opens beside it.
  2. Choose a role:
    • Any Authenticated User: everyone who is signed in.
    • An existing role, for example editor.
    • Add custom role: type a new role name in Enter role name..., for example staff, and press Enter.
  3. The lock icon turns orange, and its tooltip changes to "Requires authentication and a specific role".

Keep a page for subscribers (online stores)

In a TeleportHQ online store that sells subscriptions, a page can be kept for customers who are paying for one. The Subscriber Access switch shows in a page's menu only when the project has a store and sign-in.

  1. Make sure at least one product is sold as a subscription. In the E-Commerce panel, its card says Recurring, for example "Recurring · every month". See How to add a product.
  2. In the Pages list, open the page's menu, for example for members-recipes.
  3. Turn on Subscriber Access. This also turns on Require Authentication.
  4. To accept only some products, point at Subscriber Access. In the Who can view panel, keep Any active subscription, or tick the products that count.
A page's menu in a TeleportHQ online store, with the Subscriber Access switch under Require Authentication

If no product is a subscription yet, the switch is greyed out and its info icon says "No recurring products yet — mark a product as recurring in the E-Commerce panel". Subscriber Access is set page by page: folders and Page settings → Security don't have it.

Publish

Protection reaches your live pages only after you publish. At the top right, click Publish and publish your site. See How to publish a web app.

Protect a whole folder

Right-click a folder in the Pages list, or click its … button, and turn on Require Authentication. Every page inside it is protected too. The folder's lock icon says "This folder requires authentication", or "This folder requires specific role access" once you pick a role.

Check that it worked

In the TeleportHQ editor, protected pages still open on the canvas. While you preview as a visitor who may not see the page (Logged Out, or a user without the role), a red Access Restricted label shows at the top left of the canvas. Point at it to read why, for example "This page requires authentication. You are currently previewing as a logged-out user." An orange Partial Access Restriction label means the page holds a component that only some visitors see. See How to preview your site as a signed-in user.

The red Access Restricted label at the top left of the TeleportHQ canvas, on a members-only page previewed as Logged Out

On your published site:

  1. Open the protected page in a private browser window, where you aren't signed in. You're sent to the sign-in page.
  2. Sign in, then open the protected page again. You can now see it.
  3. Sign in as a user without the required role. You're sent to the homepage. If your homepage has a Custom Redirect to a page this user can't open either, you're sent to the sign-in page instead, and its address ends in ?error=forbidden. There you can sign in with an account that has the role.
  4. For a subscriber page, sign in as a customer without an active subscription. You're sent to the page of a product that unlocks it, or to your store's products.

Troubleshooting

Role Protection doesn't appear in the menu It shows only after Require Authentication is on and authentication is turned on in the project.

I can't turn on Require Authentication Authentication isn't turned on. Turn it on first with the padlock button at the top left of the canvas. You can always turn protection off, even without authentication.

The Subscriber Access switch is missing or greyed out It's missing when the project has no store. It's greyed out until at least one product is sold as a subscription.

The page is still public on my live site Protection only applies after you publish. Publish again and reload the page in a private window.

All my pages became public Turning off authentication removes Require Authentication from every page and folder. Turn authentication on again, then protect the pages again.

Good to know

  • If the protected page is your homepage and a signed-in user lacks its role, they're sent to the sign-in page instead of the homepage. The same happens when your homepage redirects to a page that refuses them. See How to hide a page from Google, set a canonical URL or redirect a page.
  • An "active subscription" also covers a free trial, and a renewal payment that failed while the payment provider is still retrying it.
  • The admin panel lets in the roles set with Role Protection on its admin-panel folder. That's admin unless you change it. See How to open the admin panel on your live site.
  • Require Authentication also works on CMS collection pages and in the Components list.
Share

Related Articles

How to add sign-up and login to your site

In TeleportHQ, you add sign-up and login by clicking the Authentication (padlock) button at the top left of the canvas, or Plugins → Authentication in the left sidebar, and following the Activate Authentication steps; TeleportHQ creates the sign-in, sign-up, password and profile pages, keeps the accounts in a database and makes your site a web app.

How to manage your site's users and roles

In TeleportHQ, you manage the people who have accounts on your web app from the Users tab of the authentication window (padlock button → Manage Settings & Users → Users): a searchable list of every account where Create New User adds one, Edit opens the Edit User window to change a name or pick a role (such as admin or editor), and Remove deletes the account with everything the person added, keeping their orders, invoices and bookings.

How to preview your site as a signed-in user

In TeleportHQ, you preview your web app as a signed-in member by clicking the padlock button at the top left of the canvas, choosing Act as User and picking a user; the canvas then shows that user's details and warns with Access Restricted on pages they can't open, and Act as Logged Out shows the site as a guest again.

How to password-protect your site

On a TeleportHQ trial, or in any workspace without a paid subscription, every publish puts your site behind a 6-character password that you copy from Publish → Production → Password Protection and that stays until the workspace subscribes; on Pro or Premium the password is your choice, with Enable to add it and Remove to take it off.

How to control which collaborators see each page

In the TeleportHQ editor, open a page's menu in the Pages list (the … at the end of its row, or a right-click) and choose Permissions, then switch each collaborator on or off; Editors and Limited Viewers start with no pages, the other roles start with every page, and the Owner always sees everything.

How to publish a web app

You publish a TeleportHQ web app like a website, with Publish → Publish to Production; a web app not covered by a Web App slot can publish with a TeleportHQ watermark for 7 days, after which it needs a slot to stay online.