honeypot.check()
should throw on missing input
#443
clovis1122
started this conversation in
General
Replies: 1 comment 3 replies
-
The |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently when calling
await honeypot.check(formData);
, it will check if the fields exist, and bail if they don't. This is done by theshouldCheckHoneypot
call here:remix-utils/src/server/honeypot.ts
Lines 87 to 91 in 1325b68
I think a better default is to throw an error when the fields are missing:
honeypot.check(formData);
and have it work when the honeypot fields are missing.We could add a second parameter
{strict: false}
to control this behavior, and flip the default in the next major version. The reason forstrict
is in case there are legitimate use cases where this and other lax behaviors are desired (I don't think there are any?). If there were, I can see other things where we're currently lax which should be more strict, like checking if one or the two fields are set.Beta Was this translation helpful? Give feedback.
All reactions