Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/makinhs/restify-no-captcha
Google no-captcha recaptcha middleware for restify using request-promise
https://github.com/makinhs/restify-no-captcha
Last synced: about 1 month ago
JSON representation
Google no-captcha recaptcha middleware for restify using request-promise
- Host: GitHub
- URL: https://github.com/makinhs/restify-no-captcha
- Owner: makinhs
- Created: 2016-11-18T13:33:56.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-03-05T15:39:34.000Z (almost 6 years ago)
- Last Synced: 2024-10-14T11:20:39.574Z (2 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# restify-no-captcha
This is a small middleware to use with restify to verify Recaptcha response from [google reCaptcha](https://developers.google.com/recaptcha/)
## First thing first
```
npm install --save restify-no-captcha
```## Usage
```javascript
...var recaptchaFactory = require('restify-no-captcha');
var mySecretRecaptchaFromGoogle = 'xxxxxxDDDDAAAAbhq2P9NkorGs3bjseddDd-xz43';
var verifyRecaptchaMiddleware = recaptchaFactory.VerifyCaptchaFactory(mySecretRecaptchaFromGoogle);
...
//in your routes config
...
server.post('/some-endpoint', [
verifyRecaptchaMiddleware,
myController.post
]);
...//send a request with a field inside the body called recaptchaResponse
body : {
recaptchaResponse : 'captchaResponse' //from google js it would be grecaptcha.getResponse()
}//it will call next if recaptcha is validated, or 400 with an error object.
```