Lockit signup
Sign up users to your Express app. The module is part of Lockit.
Installation
npm install lockit-signup
var Signup = ;var lockitUtils = ;var config = ; var db = lockitUtils;var adapter = config; var app = ; // express settings// ...// sessions are required - either cookie or some sort of dbapp;app; // create new Signup instancevar signup = config adapter; // use signup.router with your appapp;
Configuration
More about configuration at lockit.
Features
- validate inputs
- hash password
- validation link expiration
- verify email address via unique tokens
- prevent duplicate email/username sign up
- resend verification email
Routes included
GET /signup
POST /signup
GET /signup/:token
GET /signup/resend-verification
POST /signup/resend-verification
REST API
If you've set exports.rest = true
in your config.js
the module behaves as follows.
- all routes have
/rest
prepended GET /rest/signup
isnext()
ed and you can catch/signup
on the clientPOST /rest/signup
stays the same but only sends JSONGET /rest/signup/:token
sends JSONGET /rest/signup/resend-verification
isnext()
ed and you can catch/signup/resend-verification
on the clientPOST /rest/signup/resend-verification
sends JSON
Test
grunt
License
MIT