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

Method activateUser

internal/config/config.go:691–704  ·  view source on GitHub ↗
(hostname, user string)

Source from the content-addressed store, hash-verified

689}
690
691func (c *AuthConfig) activateUser(hostname, user string) error {
692 found, err := c.setActiveCredential(hostname, user)
693 if err != nil {
694 return err
695 }
696 if !found {
697 return fmt.Errorf("no token found for %s", user)
698 }
699
700 // Then we'll update the active user for the host
701 c.cfg.Set([]string{hostsKey, hostname, userKey}, user)
702
703 return ghConfig.Write(c.cfg)
704}
705
706// setActiveCredential clears every host level active credential representation and copies the user's stored
707// credential into the active slot, preserving its storage form. It neither sets the active user nor writes the

Callers 4

completeLoginMethod · 0.95
SwitchUserMethod · 0.95
logoutMethod · 0.95

Calls 4

setActiveCredentialMethod · 0.95
ErrorfMethod · 0.65
SetMethod · 0.65
WriteMethod · 0.65