Gateway Auth Failure Formatter (ws-connection/auth-messages.ts)

bitterbot-desktop · src/gateway/server/ws-connection/auth-messages.ts · typescript · MIT
auth, infra, chat

Formats authentication failure messages for gateway connections.

// Source: https://github.com/Bitterbot-AI/bitterbot-desktop | License: MIT | Copyright 2025-2026 Victor Michael Gil / Bitterbot AI
// Provided via justclaw.it.com; keep this notice with the code.
import { isGatewayCliClient, isWebchatClient } from "../../../utils/message-channel.js";
import type { ResolvedGatewayAuth } from "../../auth.js";
import { GATEWAY_CLIENT_IDS } from "../../protocol/client-info.js";

export type AuthProvidedKind = "token" | "password" | "none";

export function formatGatewayAuthFailureMessage(params: {
  authMode: ResolvedGatewayAuth["mode"];
  authProvided: AuthProvidedKind;
  reason?: string;
  client?: { id?: string | null; mode?: string | null };
}): string {
  const { authMode, authProvided, reason, client } = params;
  const isCli = isGatewayCliClient(client

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key