stuartpb / recaptchable

Helps display and validate Recaptchas for node.js
MIT License
0 stars 0 forks source link

Change `verify` function signature #2

Open stuartpb opened 10 years ago

stuartpb commented 10 years ago

Verify should take the data it's verifying as the first argument. In the current construction, it takes it as an argument to the constructor (so you have to construct a new instance for every request, which is cuckoo crazytown bananapants).

As for the callback, it should be changed to take an err, with err being a new Error() with code being the error code, and message being maybe the error code explanation from https://developers.google.com/recaptcha/docs/verify (if recognized)? This way, it would match the async signature of every other function in node