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

Method activateUser

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

Source from the content-addressed store, hash-verified

640}
641
642func (c *AuthConfig) activateUser(hostname, user string) error {
643 found, err := c.setActiveCredential(hostname, user)
644 if err != nil {
645 return err
646 }
647 if !found {
648 return fmt.Errorf("no token found for %s", user)
649 }
650
651 // Then we'll update the active user for the host
652 c.cfg.Set([]string{hostsKey, hostname, userKey}, user)
653
654 return ghConfig.Write(c.cfg)
655}
656
657// setActiveCredential clears every host level active credential representation and copies the user's stored
658// 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