MCPcopy Index your code
hub / github.com/xintaofei/codeg / isAuthError

Function isAuthError

src/contexts/git-credential-context.tsx:86–98  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

84// ---------------------------------------------------------------------------
85
86function isAuthError(error: unknown): boolean {
87 const appError = extractAppCommandError(error)
88 if (appError?.code === "authentication_failed") return true
89
90 const msg = appError?.detail ?? appError?.message ?? String(error)
91 const lower = msg.toLowerCase()
92 return (
93 lower.includes("authentication failed") ||
94 lower.includes("could not read username") ||
95 lower.includes("could not read password") ||
96 lower.includes("logon failed")
97 )
98}
99
100function extractHost(url: string): string | null {
101 const trimmed = url.trim()

Callers 1

GitCredentialProviderFunction · 0.85

Calls 1

extractAppCommandErrorFunction · 0.90

Tested by

no test coverage detected