cnxh / gm-captcha

captcha for gm (https://github.com/aheckmann/gm), another node captcha lib.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#gm-captcha v0.0.1

captcha for gm (https://github.com/aheckmann/gm), another node captcha lib.

"session" and "gm" are required before using the gm-captcha

##demo

##usage

// expressjs controller
var captcha = require('gm-captcha')
// show the captcha img
captcha: function(req, res) {
	captcha.configure({
		noise: "impulse"
	})
	captcha.generate(req, function(err, buf) {
		res.end(buf)
	})
}
// validation
somethingOther: function(req, res) {
	var userInput = req.body.captcha
	if(captcha.validate(req, userInput)){
		console.log("pass")
	} else {
		console.log("not pass")
	}
}

About

captcha for gm (https://github.com/aheckmann/gm), another node captcha lib.


Languages

Language:JavaScript 100.0%