I have the following configuration for my implementation. For some reason, the affiliate_id field is acting as if it’s required but it shouldn’t be. Any idea what the problem is?
Is there anything I’m missing here? I’ve been through the documentation and according to this configuration, affiliate_id should not be a required field.
Yep looking at your setup everything is fine. family_name and given_name are required but affiliate_id should not be required. I started digging into it with our Developer Support Team.
The default validator if none is provided seems to be that the field length is greater than zero (code here).
You can provide a no-op validator instead:
Don’t you think that if validator is omitted, Auth0 Lock should simply assume it’s not a required field? Though your solution fixes the issue and I’m grateful for your help, it does appear to be a band-aid. Don’t you think so?
I understand your point completely (and was surprised by this behavior), but a similar counter-argument could be made that “If I’m putting a custom field in there, I want the user to fill it in!”.
In any case, as with many examples in the IT industry, we are stuck with the original decision, at least until a major new version arrives, for backward compatibility.
I’ll send a document PR to clarify the default behavior and this workaround.