diegosouzapw/OmniRoute · error

[Providers] could not check the credential against the…

Error message

[Providers] could not check the credential against the dashboard password:

What it means

While checking whether a new provider API key collides with the dashboard management password, the comparison threw — e.g. settings read failure or bcrypt compare error. The collision check is best-effort: it is skipped and credential creation proceeds without the dashboard-password-reuse warning the check would normally produce.

Solutions

  1. Verify the settings store is readable
  2. Ensure a valid bcrypt hash is stored for the management password
  3. Re-run the credential check after fixing the underlying read error
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/lib/db/providers.ts:132 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/4cde62a71083b4c7. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/db/providers.ts:132

  const trimmed = apiKey.trim();
  if (!trimmed) return;

  try {
    const settings = (await getSettings()) as JsonRecord;
    const stored = getStoredManagementPassword(settings);
    // Only a stored bcrypt hash is comparable. A fresh install that has never
    // bootstrapped a password has nothing to collide with.
    if (!isBcryptHash(stored)) return;
    // Both forms of the value, because neither the login route nor the
    // set-password route trims: a paste carries whitespace the password does
    // not have, and a password is allowed to carry whitespace of its own. The
    // second comparison only runs when the first fails on a different string.
    const matches =
      (await verifyManagementPassword(trimmed, stored)) ||
      (trimmed !== apiKey && (await verifyManagementPassword(apiKey, stored)));
    if (!matches) return;
  } catch (err) {
    console.warn(
      "[Providers] could not check the credential against the dashboard password:",
      err instanceof Error ? err.message : String(err)
    );
    return;
  }

  throw new ManagementPasswordAsCredentialError();
}

interface StatementLike<TRow = unknown> {
  all: (...params: unknown[]) => TRow[];
  get: (...params: unknown[]) => TRow | undefined;
  run: (...params: unknown[]) => { changes?: number };
}

interface DbLike {
  prepare: <TRow = unknown>(sql: string) => StatementLike<TRow>;
  transaction: <T>(fn: () => T) => () => T;

View on GitHub (pinned to a179ffed5b)