Skip to content
Back to skills

Public Pages

ASecurity

Which pages a signed-out visitor can open in a gated frontend — the route guard's exact-match `publicExactPaths` and prefix `publicPaths`, why an rpc published with `auth_required` false publishes no page, and how the sidebar hides routes a visitor cannot open (`useCanVisit`).

  • 10 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 18, 2026
ai-agentsfrontend

Security analysis

A100/100

Scanned November 18, 2026

npx -y skills add reliant-labs/forge --skill public-pages --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Public Pages?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Public Pages
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/reliant-labs-public-pages/badge)](https://www.skillsdirectory.com/skills/reliant-labs-public-pages)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: public-pages
description: Which pages a signed-out visitor can open in a gated frontend — the route guard's exact-match `publicExactPaths` and prefix `publicPaths`, why an rpc published with `auth_required` false publishes no page, and how the sidebar hides routes a visitor cannot open (`useCanVisit`).
---

# Public pages in a gated frontend

The route guard sends every signed-out visitor to `/auth/sign-in` unless the page is listed in `src/lib/auth/route-guard.tsx`, a file that is yours:

- `publicExactPaths` — that one page only. A public home page is `const publicExactPaths = ["/"];`.
- `publicPaths` — the path and every route under it (`"/docs"` opens `/docs/intro`). The sign-in, reset and emailed-link screens live here.

`"/"` matches the home page alone in either list. It is never a prefix of every route.

**Publishing an RPC does not publish a page.** `option (forge.v1.method) = { auth_required: false }` lets a signed-out caller reach that RPC, but the guard does not read the proto. A page can call any mix of RPCs, published or not, and which ones is only known by running it. So when you publish the RPCs a page needs, list the page in the guard too.

Links follow the guard. While it is mounted, it provides `canVisit` through `RouteAccessContext` (`src/lib/auth/route-access_gen.ts`, regenerated). The scaffolded sidebar filters its entries with `useCanVisit()`, so a signed-out visitor sees only the routes they can open. Filter your own links the same way. With no guard mounted (a public frontend, or one whose guard you removed), `useCanVisit()` allows every route.

The scaffolded home page is the dashboard, and its tiles call entity RPCs that need a session. Replace `src/app/page.tsx` with the public page before you list `"/"`.

## Projects scaffolded before these lists

The guard is scaffolded once, so an older project keeps its own copy with the single prefix list. `forge project upgrade --check` shows the template's newer `route-guard.tsx`. Port the exact list and the `RouteAccessContext.Provider` by hand. Until you do, the sidebar shows every route, as it always has: with no provider, `useCanVisit()` allows everything.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.