Private & invite-only apps

Control who can open your app and register — from public launches and invite-only betas to member portals and internal team tools.

Four visibility models for Live apps

Not every published app should let anyone on the internet click Sign up and enter. Pick one clear visibility model upfront so navigation, tables, and server auth checks stay aligned from day one.

Visibility modelPublic pagesWho can registerBest fit
Public appAnyone on the webOpen sign-up or social loginStorefronts, bookings, SaaS apps, public directories
Invite-only beta / waitlistMarketing page and waitlist form onlyValid invite token or admin-approved emailControlled betas, founder communities, cohorts
Member-only client portalBranded sign-in screen (/login) onlyInvited clients or paid subscribersAgency portals, coaching hubs, B2B dashboards
Internal company toolBranded sign-in screen (/login) onlyVerified @company.com teammates plus inviteOps dashboards, inventory, finance approvals

Why server-gated access beats hiding routes in the UI

Putting a login modal over a dashboard while /api/clients still returns data leaks every record in Chrome DevTools. True private visibility enforces two layers together:

  • Server-enforced route and API gates. Every non-public endpoint verifies an active session and approval status (active, workspace membership, or invite) before querying the database, returning 401 Unauthorized when signed out and 403 Forbidden when unapproved.
  • Search-engine exclusion (`noindex`). Emit <meta name="robots" content="noindex, nofollow"> on private routes and omit internal URLs from sitemap.xml so search engines never index private screens.

Designing clean invite tokens and waitlists

Whether you are admitting 25 beta testers a week or onboarding paying agency clients, treat invite links like one-time keys — never reusable plain URLs like /signup?invited=true.

Here is a battle-tested schema blueprint for waitlists and expiring single-use invites:

text
waitlist_requests
  id                  PK (uuid)
  email               text, unique (lowercase), not null
  full_name           text, not null
  company             text, nullable
  status              enum('pending', 'approved', 'declined'), default 'pending'
  created_at          timestamp (UTC)

invites
  id                  PK (uuid)
  email               text (lowercase), not null
  role                enum('member', 'staff', 'admin'), default 'member'
  workspace_id        FK -> workspaces.id, nullable
  token_hash          text, unique, not null     -- store hash only, never raw token
  invited_by_user_id  FK -> users.id, not null
  expires_at          timestamp (UTC), not null  -- e.g. 7 days from creation
  accepted_at         timestamp (UTC), nullable
  revoked_at          timestamp (UTC), nullable
  created_at          timestamp (UTC)

Five small rules make this invite flow rock-solid in production:

  • Hash the invite token at rest. Generate a high-entropy random token on the server, email the raw token once inside /accept-invite?token=..., and store only its cryptographic hash in invites.token_hash.
  • Bind invites to the invited email. When the recipient opens the link, pre-fill and lock their invited email address (or verify that their Google/Apple login matches invites.email) so forwarded links cannot be claimed by strangers.
  • Expire and consume atomically. Set expires_at to 7 days by default, reject expired or revoked invites cleanly, and mark accepted_at inside a database transaction so the same link can never create two accounts.
  • Give admins full visibility. Build an Invites tab showing Pending, Accepted, Expired, and Revoked rows with one-click Resend (rotates token and extends expiry) and Revoke actions.
  • Keep open registration disabled on the server. Removing the Sign up link from your header is not enough — your POST /api/auth/register route itself must reject registrations that lack a valid, unconsumed invite token.

Domain allowlists and internal tool guardrails

For internal company apps, founders often ask to "allow anyone with an @acme.com email." That is convenient, but only safe when paired with strict email verification.

  • Never trust an unverified email/password signup. If someone registers fake@acme.com with a password and your app skips email verification, an outsider walks straight into your internal dashboard.
  • Prefer Google Workspace or Microsoft SSO for internal tools. Corporate SSO confirms the teammate actually owns an active company mailbox — and if they leave the company and IT suspends their mailbox, they can no longer sign back in.
  • Combine domain allowlist with explicit role approval for sensitive tools. For finance, payroll, or admin portals, require both a verified @acme.com address and an explicit admin invite so a contractor or intern does not inherit automatic access.

Step-by-step: launching an invite-only beta or private portal

Follow these five steps to lock down your app cleanly before sharing your Live URL.

  1. Lock registration on the server first

    Configure your app so only /login, /accept-invite, and (if using a beta waitlist) / plus /waitlist are public; every other page and API route requires an authenticated, active account.

  2. Add the invite manager and branded invite emails

    Wire the invites table to send crisp invite links using your configured sending domain so invites land in inboxes rather than spam. See Branded email & delivery.

  3. Bootstrap your first Live admin safely

    Remember that Preview accounts do not copy to Live. Allow your single owner email (or create your first Live account in Cloud → Live and promote it to admin) before disabling open sign-up so you never lock yourself out.

  4. Verify private gates in an incognito window

    Open your Live URL while signed out and test direct navigation to /dashboard, /settings, and your main /api/... routes to confirm every private route redirects or returns 401.

  5. Test the full invite lifecycle end to end

    Send a real invite to a secondary email, confirm accepting works once, verify reloading the consumed link fails cleanly, and test clicking Revoke on a pending invite.

Starter prompt · App

Convert this app into an invite-only client portal. Keep only `/`, `/waitlist`, `/login`, and `/accept-invite` accessible to signed-out visitors, add `noindex, nofollow` metadata on all portal routes, and reject direct `POST /api/auth/register` attempts unless backed by a valid, unexpired, unrevoked single-use invite token hashed in an `invites` table. Add an Admin-only `/admin/invites` screen where admins can approve waitlist requests, invite clients by email with a chosen role (`member` or `staff`), send a 7-day expiring invite email, and resend or revoke pending invites. Ensure every private page and API route enforces session authentication server-side and returns `401` when signed out.

Common visibility & invite pitfalls

If an invite flow stalls or a private portal behaves unexpectedly after Publish, check these five common causes.

IssueWhat went wrongClean fix
Founder locked out on Live after turning off open registrationPreview admin account does not exist in Live, and Live blocks new sign-upsConfigure an explicit founder allowlist email for first login, or create and promote your Live admin in Cloud → Live
Private API still returns JSON when signed outLogin check was added only to frontend router instead of server API handlersAdd server auth middleware to every non-public /api/* endpoint returning 401
Invited client clicked "Continue with Google" using a personal Gmail instead of work emailInvite was bound to alex@company.com, but user authenticated with alex.personal@gmail.comShow a clear message naming the invited email ("This invite is for alex@company.com — sign in with that address or ask your admin to re-invite")
Invite emails land in Promotions or SpamSending domain lacked verified SPF, DKIM, and DMARC recordsConnect your custom domain and authenticate DNS; see Email authentication (SPF/DKIM/DMARC)
Private portal login or client names appear in Google SearchMissing noindex tags or client profile slugs leaked into sitemap.xmlExclude all private routes from sitemap.xml, emit noindex, nofollow, and keep client data strictly behind auth

Next steps

Still have a question?Ask our team and other builders on Discord.

From the blog