0.0.1 • Published 7 years ago

recaptchavalidator v0.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

reCaptchaValidator

A very simple syncronous function for testing a reCaptcha response.

Installation

npm i --save recaptchavalidator

Usage

const reCaptchaValidator = require("recaptchavalidator"),
      secret = "your google reCaptcha secret";

if (reCaptchaValidator(req.body['g-recaptcha-response'], secret)) {
    // success
}
else {
    // fail
}

Documentation

reCaptchaValidate(captchaResponse, secret)

Validate Google reCaptcha

Parameters

NameTypeDescription
captchaResponsestring'g-captcha-response'
secretstringyour Google reCaptcha secret string

Returns

boolean