* Load the persisted friendly-display block, but only for file-sourced * credentials. An env credential (`HEYGEN_API_KEY` / `HYPERFRAMES_API_KEY`) * could belong to a different key than the on-disk block, so surfacing * that block would mislabel the active account. A read error is swallowed * —
(credential: ResolvedCredential)
| 168 | * — the block is purely cosmetic and must never break `auth status`. |
| 169 | */ |
| 170 | async function loadPersistedUser(credential: ResolvedCredential): Promise<StoredUserInfo | null> { |
| 171 | if (!isFileSource(credential.source)) return null; |
| 172 | try { |
| 173 | return await loadUserInfo(); |
| 174 | } catch { |
| 175 | return null; |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | function printJsonStatus(s: VerifiedStatus): void { |
| 180 | const payload: Record<string, unknown> = { |
no test coverage detected