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)
| 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. |
| 636 | func (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. |
no test coverage detected