Skip to content

feat: support gateway token auth on first connect + signed device reconnect#17

Merged
BunsDev merged 1 commit intoOpenKnots:mainfrom
mateu:mx/auth-token
Mar 12, 2026
Merged

feat: support gateway token auth on first connect + signed device reconnect#17
BunsDev merged 1 commit intoOpenKnots:mainfrom
mateu:mx/auth-token

Conversation

@mateu
Copy link
Copy Markdown
Contributor

@mateu mateu commented Mar 11, 2026

Summary

  • Supports both gateway auth modes by sending auth.password and auth.token in connect payloads.
  • Splits connect flow by state:
    • First connect (no stored token): auth-only connect, no device signature block.
    • Returning device (stored token): signed device payload + stored token for auth.token.
  • Updates desktop config resolution to prefer gateway.auth.token, with gateway.auth.password / OPENCLAW_GATEWAY_TOKEN fallback.

Why

Fixes first-connect auth/signature mismatch while preserving signed reconnect behavior.

Tests

  • Updated tests/gateway-protocol.test.ts
  • Added tests/gateway-context.test.tsx (both connect paths)
  • Focused tests passing.

Note

  • next-env.d.ts generated-path change is intentionally not part of this PR.

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.

2 participants