code: func ConvertUsernameToIdentifier(username string, usrMgr *user.Manager, valMgr *validation.Manager) (string, error) {
  	userIdentifier := username
  	usr, err := usrMgr.GetByName(username)
  	if err != nil {
  		return userIdentifier, err
  	}
  	// check for a validated email address
  	for _, email := range usr.EmailAddresses {
  		validated, err := valMgr.IsEmailAddressValidated(username, email.EmailAddress)
  		if err != nil {
  			return userIdentifier, err
  		}
  		if validated {
  			return email.EmailAddress, err
  		}
  	}
  	// try the phone numbers
  	for _, phone := range usr.Phonenumbers {
  		validated, err := valMgr.IsPhonenumberValidated(username, phone.Phonenumber)
  		if err != nil {
  			return userIdentifier, err
  		}
  		if validated {
  			return phone.Phonenumber, err
  		}
  	}
  	// No verified email or phone number. Fallback to username
  	return userIdentifier, err
  }
docs: // ConvertUsernameToIdentifier converts a username into an identifier. It tries validated email addresses first. If
  // there are none, attempt to use validated phone numbers. If the user also doesn't have any of those, keep the username