-
-
Notifications
You must be signed in to change notification settings - Fork 39.8k
Open
Description
Bug
When gateway.controlUi.dangerouslyDisableDeviceAuth: true is set, the dashboard connects successfully but cannot perform any operations because all scopes are stripped to [], resulting in "missing scope: operator.read" errors.
Root cause
In the gateway WebSocket handshake (gateway-cli-*.js), when dangerouslyDisableDeviceAuth is true, device is set to null. This triggers the if (!device) branch which unconditionally clears scopes:
if (!device) {
if (scopes.length > 0) {
scopes = [];
connectParams.scopes = scopes;
}This should respect allowControlUiBypass:
if (scopes.length > 0 && !allowControlUiBypass) {Related issue: device_token_mismatch on local connections
The reason dangerouslyDisableDeviceAuth was needed in the first place: fresh local browser connections to the dashboard fail with device_token_mismatch. The gateway validates the gateway auth token as a device-specific token and rejects it before reaching the auto-pair flow.
Flow:
- Dashboard connects with gateway auth token + fresh device identity (Ed25519 keypair)
authorizeGatewayConnectvalidates the gateway token ✅- But then the code at
if (!authOk && connectParams.auth?.token && device)callsverifyDeviceTokenusing the gateway token as if it were a device token - This fails →
device_token_mismatch - Connection rejected before reaching the
requirePairingflow that would auto-approve local clients
Environment
- OpenClaw 2026.2.14 (c1feda1)
- macOS (arm64), Node v24.6.0
- Loopback-only gateway (127.0.0.1:18789)
- Fresh install, fresh browsers (Safari + Chrome both affected)
Workaround
- Set
gateway.controlUi.dangerouslyDisableDeviceAuth: true - Patch scope stripping: change
if (scopes.length > 0)toif (scopes.length > 0 && !allowControlUiBypass)in the!devicebranch
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels