| 301 | } |
| 302 | |
| 303 | func authRecoveryCommand(cfg gh.Config, httpErr api.HTTPError) string { |
| 304 | if httpErr.RequestURL == nil { |
| 305 | return "gh auth login" |
| 306 | } |
| 307 | |
| 308 | hostname := ghauth.NormalizeHostname(httpErr.RequestURL.Hostname()) |
| 309 | token, source := cfg.Authentication().ActiveToken(hostname) |
| 310 | if shared.AuthTokenRefreshable(token, source) { |
| 311 | return fmt.Sprintf("gh auth refresh -h %s", hostname) |
| 312 | } |
| 313 | |
| 314 | return fmt.Sprintf("gh auth login -h %s", hostname) |
| 315 | } |
| 316 | |
| 317 | func checkForUpdate(ctx context.Context, f *cmdutil.Factory, currentVersion string) (*update.ReleaseInfo, error) { |
| 318 | if updaterEnabled == "" || !update.ShouldCheckForUpdate() { |