code: func SearchUser(r *http.Request, searchString string) (*user.User, error) {
  	userMgr := user.NewManager(r)
  	usr, err := userMgr.GetByName(searchString)
  	if err == nil {
  		return usr, err
  	}
  	if !db.IsNotFound(err) {
  		return nil, err
  	}
  	valMgr := validationdb.NewManager(r)
  	validatedPhonenumber, err := valMgr.GetByPhoneNumber(searchString)
  	if err != nil && !db.IsNotFound(err) {
  		return nil, err
  	}
  	if !db.IsNotFound(err) {
  		return userMgr.GetByName(validatedPhonenumber.Username)
  	}
  	validatedEmailAddress, err := valMgr.GetByEmailAddress(searchString)
  	if err != nil && !db.IsNotFound(err) {
  		return nil, err
  	}
  	if !db.IsNotFound(err) {
  		return userMgr.GetByName(validatedEmailAddress.Username)
  	}
  	idMgr := iyoid.NewManager(r)
  	clientID, _ := context.Get(r, "client_id").(string)
  	idObj, err := idMgr.GetByIDAndAZP(searchString, clientID)
  	if err != nil {
  		return nil, err
  	}
  	return userMgr.GetByName(idObj.Username)
  }
docs: // SearchUser identifies a user based on a valid user identifier