code: func (m *MMClient) Login() error {
  	// check if this is a first connect or a reconnection
  	firstConnection := true
  	if m.WsConnected {
  		firstConnection = false
  	}
  	m.WsConnected = false
  	if m.WsQuit {
  		return nil
  	}
  	b := &backoff.Backoff{
  		Min:    time.Second,
  		Max:    5 * time.Minute,
  		Jitter: true,
  	}
  
  	// do initialization setup
  	if err := m.initClient(firstConnection, b); err != nil {
  		return err
  	}
  
  	if err := m.doLogin(firstConnection, b); err != nil {
  		return err
  	}
  
  	if err := m.initUser(); err != nil {
  		return err
  	}
  
  	if m.Team == nil {
  		validTeamNames := make([]string, len(m.OtherTeams))
  		for i, t := range m.OtherTeams {
  			validTeamNames[i] = t.Team.Name
  		}
  		return fmt.Errorf("Team '%s' not found in %v", m.Credentials.Team, validTeamNames)
  	}
  
  	m.wsConnect()
  
  	return nil
  }
docs: // Login tries to connect the client with the loging details with which it was initialized.