fix: use www.clawhub.ai in well-known discovery config#121
fix: use www.clawhub.ai in well-known discovery config#121jontsai wants to merge 1 commit intoopenclaw:mainfrom
Conversation
clawhub.ai 307-redirects to www.clawhub.ai (Vercel hosting). Node's fetch() strips the Authorization header on cross-origin redirects per HTTP spec, causing CLI auth to fail with 'Unauthorized' during login, whoami, and publish commands. Fix: point apiBase, authBase, and registry to www.clawhub.ai directly, bypassing the redirect entirely.
|
@jontsai is attempting to deploy a commit to the Amantus Machina Team on Vercel. A member of the Team first needs to authorize it. |
| "apiBase": "https://www.clawhub.ai", | ||
| "authBase": "https://www.clawhub.ai", | ||
| "minCliVersion": "0.1.0", | ||
| "registry": "https://clawhub.ai" | ||
| "registry": "https://www.clawhub.ai" |
There was a problem hiding this comment.
clawhub.json still has the old values (https://clawhub.ai) for authBase and registry, which looks like it would keep the 307-redirect + dropped Authorization header issue for those endpoints. It probably should match the diff intent and use https://www.clawhub.ai for all three fields.
Also appears in public/.well-known/clawdhub.json (same lines).
Prompt To Fix With AI
This is a comment left during a code review.
Path: public/.well-known/clawhub.json
Line: 2:5
Comment:
`clawhub.json` still has the old values (`https://clawhub.ai`) for `authBase` and `registry`, which looks like it would keep the 307-redirect + dropped `Authorization` header issue for those endpoints. It probably should match the diff intent and use `https://www.clawhub.ai` for all three fields.
Also appears in `public/.well-known/clawdhub.json` (same lines).
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
All three fields (apiBase, authBase, registry) are already updated to https://www.clawhub.ai in both files. The diff shows all 6 line changes (3 per file). Perhaps the diff rendering was confusing — here's the full file after the change:
{
"apiBase": "https://www.clawhub.ai",
"authBase": "https://www.clawhub.ai",
"minCliVersion": "0.1.0",
"registry": "https://www.clawhub.ai"
}Both clawhub.json and clawdhub.json have the same fix applied.
Problem
clawhub loginfails withUnauthorizedfor all users.Root cause: The
.well-known/clawhub.jsondiscovery config advertiseshttps://clawhub.aias theapiBase, butclawhub.ai307-redirects towww.clawhub.ai(Vercel hosting).Node.js's
fetch()strips theAuthorizationheader on cross-origin redirects per HTTP spec (clawhub.ai→www.clawhub.aiis considered cross-origin). The CLI sends the auth token toclawhub.ai, gets redirected, and the token is dropped before reachingwww.clawhub.ai.This affects:
clawhub login(browser flow callback validation)clawhub login --no-browser --tokenclawhub whoamiclawhub publishFix
Update
apiBase,authBase, andregistryin both.well-known/clawhub.jsonand.well-known/clawdhub.jsonto usehttps://www.clawhub.aidirectly, bypassing the redirect.Repro
Files Changed
public/.well-known/clawhub.jsonpublic/.well-known/clawdhub.jsonGreptile Overview
Greptile Summary
This PR updates the CLI discovery configuration served from
public/.well-known/*.jsonso the CLI useshttps://www.clawhub.aidirectly, avoiding theclawhub.ai→www.clawhub.airedirect that causes Node’sfetch()to dropAuthorizationheaders on cross-origin redirects.The change fits into the codebase as static discovery metadata (served via the web app’s
public/assets) that the CLI reads to determineapiBase,authBase, andregistrylocations for authenticated operations.Confidence Score: 3/5
authBaseandregistrymay still point athttps://clawhub.ai, which would undercut the stated fix and likely keep auth flows broken for some calls.(5/5) You can turn off certain types of comments like style here!
Context used:
dashboard- AGENTS.md (source)