Skip to content

0.15.0: never charge sign-in, account, checkout or webhook paths - #24

Merged
ralyodio merged 1 commit into
mainfrom
fix/never-gate-auth-app-surfaces
Oct 28, 2026
Merged

ralyodio merged 1 commit into
mainfrom
fix/never-gate-auth-app-surfaces

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Problem

Since 0.8.0 (chargeStaleBrowsers, headless list) a request with a Chrome string two years old, or HeadlessChrome, is charged on every path. That includes /login, /signup, /oauth/*, /dashboard, /pay/*, /api/health and webhooks. Reproduced 2026-10-28 on coinpayportal.com, ugig.net, crawlproof.com, smshub.dev, saasrow.com, pit.world, nixamp.com, profullstack.com, bittorrented.com: a Chrome/120 UA gets 402 on /login and /signup. An agent whose CoinPay OAuth token lapsed could not re-authenticate, so its listings became unpayable.

Fix

  • APP_PATHS (exported, frozen) + isAppPath(path, paths): sign-in, account, checkout, pay, webhook and health paths, matched by whole segment (/pay covers /pay/x, not /payouts-explained).
  • handle() returns null for them right after exempt, before the crawler lists, challenge and free quota.
  • appPaths option appends site paths (e.g. '/api' for an app whose whole API is credentialed); false disables.
  • d.ts + README.
  • test/verify-badge.test.js imported vitest, which is not a dependency, and has kept main's CI red since feat: add x402 verification badge endpoint for external indexers #23. Ported it to node:test.

Tests

node --test: 183 pass. New test/app-paths.test.js covers stale Chrome, HeadlessChrome and GPTBot on app paths (null) and content (402), segment matching, appPaths extension and false.

🤖 Generated with Claude Code

Since 0.8 a stale or headless browser string is charged on every path,
including /login, /signup, /oauth, /dashboard, /pay and /api/*. Every fleet
site on ^0.13.1 answered an old Chrome or HeadlessChrome with 402 there, so an
agent whose CoinPay OAuth token lapsed could not sign back in.

APP_PATHS (exported, with isAppPath) lists those surfaces; handle() lets them
through after `exempt`. Sites append their own with `appPaths`, or pass false.

Also ports test/verify-badge.test.js from vitest (not a dependency) to
node:test, which had main's CI red since #23.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ralyodio
ralyodio merged commit ac189ac into main Oct 28, 2026
6 checks passed
@ralyodio
ralyodio deleted the fix/never-gate-auth-app-surfaces branch October 28, 2026 09:42
This was referenced Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant