MCPcopy
hub / github.com/cli/cli / authRecoveryCommand

Function authRecoveryCommand

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

Source from the content-addressed store, hash-verified

301}
302
303func 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
317func checkForUpdate(ctx context.Context, f *cmdutil.Factory, currentVersion string) (*update.ReleaseInfo, error) {
318 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