clawhub login fails with 'Unauthorized' after browser auth completes #44

Open
opened 2026-02-15 17:15:19 -05:00 by yindo · 1 comment
Owner

Originally created by @eNNNo on GitHub (Feb 2, 2026).

Bug Report

Environment

  • clawhub CLI version: 0.4.0
  • OS: macOS
  • Node.js: v24.13.0

Steps to Reproduce

  1. Run clawhub login
  2. Browser opens to clawhub.ai auth page
  3. Successfully authenticate in browser
  4. CLI shows "Unauthorized" error

Expected Behavior

CLI should receive the auth callback and store the token.

Actual Behavior

Opening browser: https://clawhub.ai/cli/auth?redirect_uri=http://127.0.0.1:58771/callback&...
✖ Unauthorized
Error: Unauthorized

Additional Context

  • Also tried clawhub auth login --token <token> with a freshly generated token from clawhub.ai - same "Unauthorized" error
  • Browser auth flow completes successfully on the web side
  • The localhost callback doesn't seem to be received properly
Originally created by @eNNNo on GitHub (Feb 2, 2026). ## Bug Report ### Environment - clawhub CLI version: 0.4.0 - OS: macOS - Node.js: v24.13.0 ### Steps to Reproduce 1. Run `clawhub login` 2. Browser opens to clawhub.ai auth page 3. Successfully authenticate in browser 4. CLI shows "Unauthorized" error ### Expected Behavior CLI should receive the auth callback and store the token. ### Actual Behavior ``` Opening browser: https://clawhub.ai/cli/auth?redirect_uri=http://127.0.0.1:58771/callback&... ✖ Unauthorized Error: Unauthorized ``` ### Additional Context - Also tried `clawhub auth login --token <token>` with a freshly generated token from clawhub.ai - same "Unauthorized" error - Browser auth flow completes successfully on the web side - The localhost callback doesn't seem to be received properly
Author
Owner

@BrennerSpear commented on GitHub (Feb 3, 2026):

Workaround until the fix is merged:

CLAWHUB_REGISTRY=https://www.clawhub.ai clawhub login --token <your-token>

Or set the env var permanently:

export CLAWHUB_REGISTRY=https://www.clawhub.ai

This bypasses the redirect from clawhub.aiwww.clawhub.ai that strips the auth header.

@BrennerSpear commented on GitHub (Feb 3, 2026): **Workaround until the fix is merged:** ```bash CLAWHUB_REGISTRY=https://www.clawhub.ai clawhub login --token <your-token> ``` Or set the env var permanently: ```bash export CLAWHUB_REGISTRY=https://www.clawhub.ai ``` This bypasses the redirect from `clawhub.ai` → `www.clawhub.ai` that strips the auth header.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: openclaw/clawhub#44