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

Method TokenForUser

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

TokenForUser retrieves the credential for a specified user and hostname. Like ActiveToken it returns the last stored token as-is, including the current access token of a refreshable credential, and never refreshes it; use TokenForUserWithRefresh when the token must be valid for API calls.

(hostname, user string)

Source from the content-addressed store, hash-verified

316 // stored token as-is, including the current access token of a refreshable credential, and never refreshes it; use
317 // TokenForUserWithRefresh when the token must be valid for API calls.
318 TokenForUser(hostname, user string) (credential Credential, err error)
319
320 // SetTokenRefresher supplies the refresher used to renew tokens. It is provided after construction because the
321 // refresher depends on the plain HTTP client, which is only available once the command factory has assembled its

Implementers 1

AuthConfiginternal/config/config.go

Calls

no outgoing calls