Skip to content

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

Open
mateu wants to merge 1 commit intoOpenKnots:mainfrom
mateu:mx/auth-token
Open

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

Conversation

@mateu
Copy link

@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.

1 participant