MCPcopy Create free account
hub / github.com/cli/cli / authRecoveryCommand

Function authRecoveryCommand

internal/ghcmd/cmd.go:316–328  ·  view source on GitHub ↗
(cfg gh.Config, httpErr api.HTTPError)

Source from the content-addressed store, hash-verified

314}
315
316func 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
330func checkForUpdate(ctx context.Context, f *cmdutil.Factory, currentVersion string) (*update.ReleaseInfo, error) {
331 if updaterEnabled == "" || !update.ShouldCheckForUpdate() {

Callers 2

MainFunction · 0.85
Test_authRecoveryCommandFunction · 0.85

Calls 3

AuthTokenRefreshableFunction · 0.92
ActiveTokenMethod · 0.65
AuthenticationMethod · 0.65

Tested by 1

Test_authRecoveryCommandFunction · 0.68