const AUTH_PUBLIC_PREFIXES = ["/login", "/auth/", "/api/auth/"]

/** Routes without session enforcement (login, public shares, interactive demos). */
export function isAuthPublicPath(pathname: string): boolean {
  if (pathname === "/") return true
  if (pathname.startsWith("/drive/s/")) return true
  if (pathname === "/demo" || pathname.startsWith("/demo/")) return true
  if (pathname.startsWith("/onboard/")) return true
  return AUTH_PUBLIC_PREFIXES.some(
    (prefix) => pathname === prefix || pathname.startsWith(prefix)
  )
}

export function isDemoPublicPath(pathname: string): boolean {
  return pathname === "/demo" || pathname.startsWith("/demo/")
}
