项目作者: BrianEmilius

项目描述 :
Handles Google reCaptcha verification asynchronously
高级语言: JavaScript
项目地址: git://github.com/BrianEmilius/async-recaptcha.git
创建时间: 2017-06-14T10:08:19Z
项目社区:https://github.com/BrianEmilius/async-recaptcha

开源协议:MIT License

下载


async-recaptcha

Handles Google reCaptcha verification asynchronously.

Installation

npm i -S async-recaptcha

Usage

  1. const asyncRecaptcha = require("async-recaptcha"),
  2. secret = "your google reCaptcha secret key";
  3. // this example uses express/body-parser to get the g-captcha-response string
  4. asyncRecaptcha(req.body['g-recaptcha-response'], secret)
  5. .then(function() {
  6. // success
  7. })
  8. .catch(function(error) {
  9. // fail
  10. console.log(error);
  11. });

Documentation

asyncRecaptcha(captchaResponse, secret)

Validate Google reCaptcha

Parameters

Name Type Description
captchaResponse string ‘g-captcha-response’
secret string your Google reCaptcha secret string

Returns

Promise