{"record":{"id":"4cde62a71083b4c7","repo":"diegosouzapw/OmniRoute","slug":"providers-could-not-check-the-credential-against","errorCode":null,"errorMessage":"[Providers] could not check the credential against the dashboard password:","messagePattern":"\\[Providers\\] could not check the credential against the dashboard password:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/db/providers.ts","lineNumber":132,"sourceCode":"  const trimmed = apiKey.trim();\n  if (!trimmed) return;\n\n  try {\n    const settings = (await getSettings()) as JsonRecord;\n    const stored = getStoredManagementPassword(settings);\n    // Only a stored bcrypt hash is comparable. A fresh install that has never\n    // bootstrapped a password has nothing to collide with.\n    if (!isBcryptHash(stored)) return;\n    // Both forms of the value, because neither the login route nor the\n    // set-password route trims: a paste carries whitespace the password does\n    // not have, and a password is allowed to carry whitespace of its own. The\n    // second comparison only runs when the first fails on a different string.\n    const matches =\n      (await verifyManagementPassword(trimmed, stored)) ||\n      (trimmed !== apiKey && (await verifyManagementPassword(apiKey, stored)));\n    if (!matches) return;\n  } catch (err) {\n    console.warn(\n      \"[Providers] could not check the credential against the dashboard password:\",\n      err instanceof Error ? err.message : String(err)\n    );\n    return;\n  }\n\n  throw new ManagementPasswordAsCredentialError();\n}\n\ninterface StatementLike<TRow = unknown> {\n  all: (...params: unknown[]) => TRow[];\n  get: (...params: unknown[]) => TRow | undefined;\n  run: (...params: unknown[]) => { changes?: number };\n}\n\ninterface DbLike {\n  prepare: <TRow = unknown>(sql: string) => StatementLike<TRow>;\n  transaction: <T>(fn: () => T) => () => T;","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/db/providers.ts#L114-L150","documentation":"Error \"[Providers] could not check the credential against the dashboard password:\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/db/providers.ts:132 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}