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

Method warnRejectedKept

internal/config/refreshable.go:636–642  ·  view source on GitHub ↗

warnRejectedKept warns that the server rejected the refresh token while gh did not hold the refresh lock, so the stored credential was kept and the caller receives no token. Without the lock the rejection may only mean that a peer spent the same refresh token first, so the advice to sign in again is

(hostname, username string)

Source from the content-addressed store, hash-verified

634// stored credential was kept and the caller receives no token. Without the lock the rejection may only mean that a peer
635// spent the same refresh token first, so the advice to sign in again is conditional.
636func (c *AuthConfig) warnRejectedKept(hostname, username string) {
637 c.addWarning(fmt.Sprintf(
638 "The refresh token of account %s on %s was rejected, so gh could not authenticate as that account. gh kept the "+
639 "stored credential because another gh process may have renewed it at the same time. "+
640 "If this persists, run `gh auth login -h %s` to sign in again.",
641 username, hostname, hostname))
642}
643
644// removeRejectedCredential removes the user's stored credential after the server rejected its refresh token, and
645// records the outcome on attempt. secure tells whether the credential was read from the keyring.

Callers 1

Calls 1

addWarningMethod · 0.95

Tested by

no test coverage detected