Closed SimonSchick closed 6 years ago
Hi @SimonSchick, I will have a look on this, next week.
@pdupavillon thanks for the fast response 😄
@SimonSchick, I change couple of things as you can see in the PR #14
new Recaptcha(...)
replace recaptcha.init(...)
(see readme for more infos)response
object instead of request
, which means, by using the middleware, you can access to the rendered template with res.recaptcha
request
object but returns an object with the error property and data (see readme for more infos)Feel free to test and tell me if it fits your needs :)
Migration to typescript done with PR #17. Definition files are include in the last release.
I used your project recently and created typings:
You might want to change your exports tho, exporting an instance of a class as
module.exports
is very hard to model in TS.Ideally you'd export
exports.Recaptcha = Recaptcha
. I'd also suggest changingreq.recaptcha
to be{ template: string; error: string }
. Or you just move the entire thing to TS, all of these changes are breaking anyways.