npm install lockit-signup


Sign up users to your Express app. The module is part of Lockit.
npm install lockit-signup
``js
var Signup = require('lockit-signup');
var lockitUtils = require('lockit-utils');
var config = require('./config.js');
var db = lockitUtils.getDatabase(config);
var adapter = require(db.adapter)(config);
var app = express();
// express settings
// ...
// sessions are required - either cookie or some sort of db
app.use(cookieParser());
app.use(cookieSession({
secret: 'this is my super secret string'
}));
// create new Signup instance
var signup = new Signup(config, adapter);
// use signup.router with your app
app.use(signup.router);
`
More about configuration at lockit.
- validate inputs
- hash password
- validation link expiration
- verify email address via unique tokens
- prevent duplicate email/username sign up
- resend verification email
- GET /signupPOST /signup
- GET /signup/:token
- GET /signup/resend-verification
- POST /signup/resend-verification
-
If you've set exports.rest = true in your config.js the module behaves as follows.
- all routes have /rest prependedGET /rest/signup
- is next()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
- is next()ed and you can catch /signup/resend-verification on the clientPOST /rest/signup/resend-verification
- sends JSON
grunt`
MIT