diegosouzapw/OmniRoute · error · Error

Bearer token is required

Error message

Bearer token is required

What it means

First field check in RaycastService.validateCredentials: after trimming, accessToken is empty. Pure local validation — the import call passed no Bearer token (and it could not be derived from anything else). Raycast Pro requests require this Bearer token.

Solutions

  1. Extract the Raycast oauth access_token (Keychain raycast-store_credentials) and pass it as accessToken
  2. Validate non-empty input at the import UI before calling validateCredentials
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/lib/oauth/services/raycast.ts:31 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/b3708b5ac311bd3c. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/oauth/services/raycast.ts:31

} from "@omniroute/open-sse/services/raycast.ts";

export class RaycastService {
  validateCredentials(input: {
    accessToken: string;
    deviceId: string;
    aid?: string;
    signatureJwt?: string;
    sigSecret?: string;
  }): { aid: string } {
    const accessToken = input.accessToken.trim();
    const deviceId = input.deviceId.trim();
    let aid = (input.aid || "").trim();

    if (!aid && input.signatureJwt?.trim()) {
      aid = decodeAidFromRaycastJwt(input.signatureJwt.trim()) || "";
    }

    if (!accessToken) throw new Error("Bearer token is required");
    if (!deviceId) throw new Error("Device ID is required");

    // AID is optional for current Raycast API — fall back to deviceId when not captured manually.
    if (!aid) aid = deviceId;

    return { aid };
  }

  async probeModels(credentials: {
    accessToken: string;
    deviceId: string;
    aid: string;
    sigSecret?: string;
  }): Promise<RaycastModelEntry[]> {
    return fetchRaycastModels({
      accessToken: credentials.accessToken,
      providerSpecificData: {
        deviceId: credentials.deviceId,

View on GitHub (pinned to a179ffed5b)