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

Method TokenForUser

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

307 // stored token as-is, including the current access token of a refreshable credential, and never refreshes it; use
308 // TokenForUserWithRefresh when the token must be valid for API calls.
309 TokenForUser(hostname, user string) (credential Credential, err error)
310
311 // SetTokenRefresher supplies the refresher used to renew tokens. It is provided after construction because the
312 // 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