code: func (c *AuthPreferenceV2) CheckAndSetDefaults() error {
  	// if nothing is passed in, set defaults
  	if c.Spec.Type == "" {
  		c.Spec.Type = teleport.Local
  	}
  	if c.Spec.SecondFactor == "" {
  		c.Spec.SecondFactor = teleport.OTP
  	}
  
  	// make sure type makes sense
  	switch c.Spec.Type {
  	case teleport.Local, teleport.OIDC, teleport.SAML, teleport.Github:
  	default:
  		return trace.BadParameter("authentication type %q not supported", c.Spec.Type)
  	}
  
  	// make sure second factor makes sense
  	switch c.Spec.SecondFactor {
  	case teleport.OFF, teleport.OTP, teleport.U2F:
  	default:
  		return trace.BadParameter("second factor type %q not supported", c.Spec.SecondFactor)
  	}
  
  	return nil
  }
docs: // CheckAndSetDefaults verifies the constraints for AuthPreference.