Files
beenvoice/apps/web/src/lib/public-routes.ts
T
soconnor 86f8987dff Add 'apps/web/' from commit '1e7174fa604b11e7c3983cd8ad01c596f6e77e96'
git-subtree-dir: apps/web
git-subtree-mainline: 068a51b46b
git-subtree-split: 1e7174fa60
2026-08-16 21:42:59 -04:00

22 lines
597 B
TypeScript

/** Routes that do not require authentication or server session lookups. */
export const PUBLIC_ROUTES = [
"/",
"/auth/signin",
"/auth/register",
"/auth/forgot-password",
"/auth/reset-password",
"/privacy",
"/terms",
] as const;
/** Path prefixes treated as public (e.g. shareable invoice links). */
export const PUBLIC_ROUTE_PREFIXES = ["/i/"] as const;
export function isPublicRoute(pathname: string): boolean {
if ((PUBLIC_ROUTES as readonly string[]).includes(pathname)) {
return true;
}
return PUBLIC_ROUTE_PREFIXES.some((prefix) => pathname.startsWith(prefix));
}