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

Method TokenForUserWithRefresh

internal/gh/gh.go:313–313  ·  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

311 // and its access token is expiring, renews and persists it. It may return a non-empty credential with an error,
312 // such as when refreshing fails. The caller decides whether to use the returned credential.
313 TokenForUserWithRefresh(hostname, username string) (credential Credential, refreshResult RefreshStatus, err error)
314
315 // TokenForUser retrieves the credential for a specified user and hostname. Like ActiveToken it returns the last
316 // 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