| 314 | } |
| 315 | |
| 316 | func authRecoveryCommand(cfg gh.Config, httpErr api.HTTPError) string { |
| 317 | if httpErr.RequestURL == nil { |
| 318 | return "gh auth login" |
| 319 | } |
| 320 | |
| 321 | hostname := ghauth.NormalizeHostname(httpErr.RequestURL.Hostname()) |
| 322 | token, source := cfg.Authentication().ActiveToken(hostname) |
| 323 | if shared.AuthTokenRefreshable(token, source) { |
| 324 | return fmt.Sprintf("gh auth refresh -h %s", hostname) |
| 325 | } |
| 326 | |
| 327 | return fmt.Sprintf("gh auth login -h %s", hostname) |
| 328 | } |
| 329 | |
| 330 | func checkForUpdate(ctx context.Context, f *cmdutil.Factory, currentVersion string) (*update.ReleaseInfo, error) { |
| 331 | if updaterEnabled == "" || !update.ShouldCheckForUpdate() { |