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)
| 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. |
| 625 | func (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 |
nothing calls this directly
no test coverage detected