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