MCPcopy Create free account
hub / github.com/cli/cli / TokenForUserWithRefresh

Method TokenForUserWithRefresh

internal/gh/gh.go:304–304  ·  view source on GitHub ↗

TokenForUserWithRefresh retrieves the credential for a specified user and hostname and, when it is refreshable and its access token is expiring, renews and persists it. It may return a non-empty credential with an error, such as when refreshing fails. The caller decides whether to use the returned c

(hostname, username string)

Source from the content-addressed store, hash-verified

302 // and its access token is expiring, renews and persists it. It may return a non-empty credential with an error,
303 // such as when refreshing fails. The caller decides whether to use the returned credential.
304 TokenForUserWithRefresh(hostname, username string) (credential Credential, refreshResult RefreshStatus, err error)
305
306 // TokenForUser retrieves the credential for a specified user and hostname. Like ActiveToken it returns the last
307 // stored token as-is, including the current access token of a refreshable credential, and never refreshes it; use

Callers 3

getTokenWithRefreshFunction · 0.65
resolveCredentialFunction · 0.65

Implementers 1

AuthConfiginternal/config/config.go

Calls

no outgoing calls

Tested by 1