1.2.2 • Published 10 years ago
lockit-signup v1.2.2
Lockit signup
Sign up users to your Express app. The module is part of Lockit.
Installation
npm install lockit-signup
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);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 /signupPOST /signupGET /signup/:tokenGET /signup/resend-verificationPOST /signup/resend-verification
REST API
If you've set exports.rest = true in your config.js the module behaves as follows.
- all routes have
/restprepended GET /rest/signupisnext()ed and you can catch/signupon the clientPOST /rest/signupstays the same but only sends JSONGET /rest/signup/:tokensends JSONGET /rest/signup/resend-verificationisnext()ed and you can catch/signup/resend-verificationon the clientPOST /rest/signup/resend-verificationsends JSON
Test
grunt
License
MIT
1.2.2
10 years ago
1.2.1
10 years ago
1.2.0
11 years ago
1.1.1
11 years ago
1.1.0
11 years ago
1.0.0
12 years ago
0.7.1
12 years ago
0.7.0
12 years ago
0.6.0
12 years ago
0.5.2
12 years ago
0.5.1
12 years ago
0.5.0
12 years ago
0.4.4
12 years ago
0.4.3
12 years ago
0.4.2
12 years ago
0.4.1
12 years ago
0.4.0
12 years ago
0.3.0
12 years ago
0.2.0
12 years ago
0.0.5
12 years ago
0.0.4
12 years ago
0.0.3
12 years ago
0.0.1
12 years ago