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

Method Logout

internal/config/config.go:625–631  ·  view source on GitHub ↗

Logout will remove user, git protocol, and auth token for the given hostname. It will remove the auth token from the encrypted storage if it exists there.

(hostname, username string)

Source from the content-addressed store, hash-verified

623// Logout will remove user, git protocol, and auth token for the given hostname.
624// It will remove the auth token from the encrypted storage if it exists there.
625func (c *AuthConfig) Logout(hostname, username string) error {
626 // Run under the shared refresh lock so logout wins any race with an in-flight refresh: a concurrent refresh
627 // cannot persist a rotated credential after logout has removed the account and reported success.
628 return c.withFreshConfigForRefresh(func(lockErr error) error {
629 return c.logout(hostname, username)
630 })
631}
632
633// LogoutWithCredential coordinates credential-dependent cleanup with concurrent refreshes.
634// Advisory locking is best effort, matching Logout. The callback receives the lock outcome

Callers

nothing calls this directly

Calls 2

logoutMethod · 0.95

Tested by

no test coverage detected