node-custom-recaptcha
v1.0.3
Published
nodejs custom recaptcha
Downloads
4
Maintainers
Readme
node-custom-recaptcha
By using this you can get captcha image src in base64 formate and captchaValue of given captcha
Installation
$ npm install node-custom-recaptcha
Code
const nodeCustomeRecaptcha = require("node-custom-recaptcha");
nodeCustomeRecaptcha.getRecaptcha(function(img, captchaValue){
console.log("getRecaptcha response....");
console.log("captchaValue : ", captchaValue);
console.log("img : ", img);
});
Example Using Express
auth.js
/**
* Requires node libraries
*/
const express = require('express');
const router = express.Router();
const nodeCustomeRecaptcha = require("node-custom-recaptcha");
/*
* Create custom captcha
*/
router
.route("/api/getRecaptcha")
.get(
function (req, res) {
nodeCustomeRecaptcha.getRecaptcha(function(img, captchaValue){
console.log("getRecaptcha response....");
console.log("captchaValue : ", captchaValue);
console.log("img : ", img);
//Store captchaValue value in session or cookie or database for verify this ReCaptcha at verification time
res.json({ captchaImgSrc : img});
});
Output
the output will be like as bellow
getRecaptcha response....
captchaValue : 5876
img : iVBORw0KGgoAAAANSUhEUgAAAFAAAAAoCAMAAABevo0zAAAAGFBMVEUyACgUKGQAAAAAAAAAAAAAAAAAAAAAAABjs+KRAAAACHRSTlMZ/wAAAAAAAEYlMpEAAAyzSURBVHjaAagMV/MAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBAQEBAQEBAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQEBAQEBAQEBAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAABAQAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQAAAAAAAAABAQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQEAAAAAAAEBAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBAQEBAQEBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQEBAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABlwAFg1ErymgAAAABJRU5ErkJggg==
Here, ->captchaValue is the value of display in ReCaptcha ->Img is the image src so if front-end you can display it by adding data:image/png;base64, like as
<img src="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAFAAAAAoCAMAAABevo0zAAAAGFBMVEUyACgUKGQAAAAAAAAAAAAAAAAAAAAAAABjs+KRAAAACHRSTlMZ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