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

Method ActiveTokenWithRefresh

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

ActiveTokenWithRefresh retrieves the active credential for the given 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 creden

(hostname string)

Source from the content-addressed store, hash-verified

229 // its access token is expiring, renews and persists it. It may return a non-empty credential with an error, such
230 // as when refreshing fails. The caller decides whether to use the returned credential.
231 ActiveTokenWithRefresh(hostname string) (credential Credential, refreshResult RefreshStatus, err error)
232
233 // Warnings returns the deduplicated warnings recorded so far in this process, such as a skipped token refresh, in
234 // the order they were first recorded. Callers are expected to show them to the user before gh exits.

Implementers 1

AuthConfiginternal/config/config.go

Calls

no outgoing calls