# OpenClaw: disconnected (1008): unauthorized: gateway token missing

> The Gateway runs in token auth mode and the client connected without the shared gateway token. The exact message, why OpenClaw prints it, and the fix.

_Updated November 23, 2026_

## The message

```text
disconnected (1008): unauthorized: gateway token missing
```

## What it means

The Gateway runs in token auth mode and the client connected without the shared gateway token. In the browser this happens when the Control UI was opened without the token or lost it; a direct loopback connection doesn't bypass token auth.

## Fix

1. On the Gateway host, print the token in an interactive terminal: `openclaw gateway auth-token --show`.
2. Paste it into the Control UI's Gateway secret field (login screen or Settings → Gateway) and connect.
3. Or run `openclaw dashboard` on the Gateway host, which opens the Control UI with a one-time pairing link so the browser no longer depends on the shared token.
4. If the Gateway started in token mode without a configured token, it generated a runtime token you can't recover: run `openclaw doctor --generate-gateway-token`, restart the Gateway, then repeat step 1.

## In an EnvHaven workspace

Yes, until OpenClaw is signed in once. Sign in once from the workspace's Launch menu (Sign in, or Set key for an API key); the sign-in stays on the workspace, across restarts and on every device.

## Where this comes from

From OpenClaw's documentation and issue tracker:

- [github.com/openclaw/openclaw/issues/17745](https://github.com/openclaw/openclaw/issues/17745)
- [github.com/openclaw/openclaw/issues/1462](https://github.com/openclaw/openclaw/issues/1462)
- [docs.openclaw.ai/gateway/troubleshooting/agent-replies-and-control-ui](https://docs.openclaw.ai/gateway/troubleshooting/agent-replies-and-control-ui)
- [docs.openclaw.ai/web/control-ui](https://docs.openclaw.ai/web/control-ui)

## Keep reading

- [OpenClaw](https://envhaven.com/agents/openclaw)
- [Is OpenClaw down?](https://envhaven.com/status/openclaw)
- [Every agent error](https://envhaven.com/errors)

Source: https://envhaven.com/errors/openclaw/gateway-token-missing
