Skip to content

Simple captcha for Node.JS and Express (or Connect).

License

Notifications You must be signed in to change notification settings

qurio-za/node-captcha

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Captcha

Simple captcha.

Installation

via npm:

$ npm install captcha

Application init:

...
var captcha = require('captcha');
...
app.configure(function(){
...
	app.use(app.router);
	app.use(captcha('/captcha.jpg')); // url for captcha jpeg
	app.use(express.static(__dirname + '/public'));
...

Render captcha:

<img src="/captcha.jpg" />

Check captcha:

app.post('/user/create', function(req, res, next){
	if(req.body.captcha != req.session.captcha) // text from captcha stored into session
		return next(new Error('Captcha stop!'));
...

About

Simple captcha for Node.JS and Express (or Connect).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published