fix: pr-bug-scan findings from #1478 (#1561)

Fixed banner Docs link to use openExternal IPC like the block variant; restricted hasKeyringFallback to same-host keyring accounts so multi-host users aren't told a fallback exists when none does.

Findings addressed:
- src/renderer/src/components/github-project/GhAuthErrorHelp.tsx:218-227 — Banner Docs link uses <a target="_blank"> instead of shell IPC
- src/main/github/auth-diagnose.ts:121-127 — hasKeyringFallback ignores host, can mislead multi-host users

Rebased onto current main to drop unrelated reverts.

Co-authored-by: orca-bot <bot@stably.ai>
This commit is contained in:
buf0-bot[bot]
2026-05-07 23:14:05 -07:00
committed by GitHub
co-authored by orca-bot
parent 32b88bcdc5
commit a3242035c2
2 changed files with 10 additions and 7 deletions
+6 -2
View File
@@ -128,8 +128,12 @@ export async function diagnoseGhAuth(): Promise<GhAuthDiagnostic> {
? REQUIRED_SCOPES.filter((s) => !active.scopes.includes(s))
: [...REQUIRED_SCOPES]
// Is there a non-env (keyring) account we could fall back to by unsetting
// the env var? Only meaningful if the active account is env-shadowed.
const keyringFallback = accounts.find((a) => a.source === 'keyring') ?? null
// the env var? Only meaningful if the active account is env-shadowed, and
// only if the keyring login is on the SAME host — otherwise unsetting the
// env var leaves the user with no credential for the host that was active.
const keyringFallback = active
? (accounts.find((a) => a.source === 'keyring' && a.host === active.host) ?? null)
: null
return {
ghAvailable,
activeAccount: active,