INNER CODE UNIT · TypeScript
removeInjectedAuthPlaceholder
BlockRunAI/ClawRouter · src/index.ts:722
function removeInjectedAuthPlaceholder(
authPath: string,
logger: { info: (msg: string) => void },
agentId: string,
): void {
try {
if (!existsSync(authPath)) return;
const parsed = JSON.parse(readTextFileSync(authPath)) as {
profiles?: Record<string, unknown>;
};
const profiles = parsed?.profiles;
if (!profiles || typeof profiles !== "object" || Array.isArray(profiles)) return;
const keys = Object.keys(profiles);
if (keys.length !== 1 || keys[0] !== "blockrun:default") return;
const entry = profiles["blockrun:default"];
if (!entry || typeof entry !== "object") return;
const profile = entry as { type?: unknown; provider?: unknown; key?: unknown };
if (