fix(gateway): improve auth error for native apps
Fixes #2268 When macOS/iOS/Android apps fail to connect due to missing auth token, the error message now clearly explains that gateway.remote.token needs to be set in ~/.clawdbot/clawdbot.json to match gateway.auth.token on the server. Before: 'unauthorized: gateway token missing (provide gateway auth token)' After: 'unauthorized: gateway token missing (set gateway.remote.token in ~/.clawdbot/clawdbot.json to match gateway.auth.token on the server)' This eliminates confusion when switching to remote mode over SSH.
This commit is contained in:
parent
dce7925e2a
commit
d91765df74
@ -79,6 +79,7 @@ Status: unreleased.
|
||||
- Gateway: default auth now fail-closed (token/password required; Tailscale Serve identity remains allowed).
|
||||
- Gateway: treat loopback + non-local Host connections as remote unless trusted proxy headers are present.
|
||||
- Onboarding: remove unsupported gateway auth "off" choice from onboarding/configure flows and CLI flags.
|
||||
- Gateway: improve auth error message for native apps (macOS/iOS/Android) to clarify gateway.remote.token setup. (#2268)
|
||||
|
||||
## 2026.1.24-3
|
||||
|
||||
|
||||
@ -83,17 +83,25 @@ function formatGatewayAuthFailureMessage(params: {
|
||||
const isCli = isGatewayCliClient(client);
|
||||
const isControlUi = client?.id === GATEWAY_CLIENT_IDS.CONTROL_UI;
|
||||
const isWebchat = isWebchatClient(client);
|
||||
const isMacOsApp = client?.id === GATEWAY_CLIENT_IDS.MACOS_APP;
|
||||
const isIosApp = client?.id === GATEWAY_CLIENT_IDS.IOS_APP;
|
||||
const isAndroidApp = client?.id === GATEWAY_CLIENT_IDS.ANDROID_APP;
|
||||
const isNativeApp = isMacOsApp || isIosApp || isAndroidApp;
|
||||
const uiHint = "open a tokenized dashboard URL or paste token in Control UI settings";
|
||||
const tokenHint = isCli
|
||||
? "set gateway.remote.token to match gateway.auth.token"
|
||||
: isControlUi || isWebchat
|
||||
? uiHint
|
||||
: "provide gateway auth token";
|
||||
: isNativeApp
|
||||
? "set gateway.remote.token in ~/.clawdbot/clawdbot.json to match gateway.auth.token on the server"
|
||||
: isControlUi || isWebchat
|
||||
? uiHint
|
||||
: "provide gateway auth token";
|
||||
const passwordHint = isCli
|
||||
? "set gateway.remote.password to match gateway.auth.password"
|
||||
: isControlUi || isWebchat
|
||||
? "enter the password in Control UI settings"
|
||||
: "provide gateway auth password";
|
||||
: isNativeApp
|
||||
? "set gateway.remote.password in ~/.clawdbot/clawdbot.json to match gateway.auth.password on the server"
|
||||
: isControlUi || isWebchat
|
||||
? "enter the password in Control UI settings"
|
||||
: "provide gateway auth password";
|
||||
switch (reason) {
|
||||
case "token_missing":
|
||||
return `unauthorized: gateway token missing (${tokenHint})`;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user