1.2.2 • Published 9 years ago

lockit-signup v1.2.2

Weekly downloads
8
License
MIT
Repository
github
Last release
9 years ago

Lockit signup

Build Status NPM version Dependency Status

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 /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 is next()ed and you can catch /signup on the client
  • POST /rest/signup stays the same but only sends JSON
  • GET /rest/signup/:token sends JSON
  • GET /rest/signup/resend-verification is next()ed and you can catch /signup/resend-verification on the client
  • POST /rest/signup/resend-verification sends JSON

Test

grunt

License

MIT

1.2.2

9 years ago

1.2.1

9 years ago

1.2.0

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.0

10 years ago

0.7.1

10 years ago

0.7.0

10 years ago

0.6.0

10 years ago

0.5.2

10 years ago

0.5.1

10 years ago

0.5.0

10 years ago

0.4.4

10 years ago

0.4.3

10 years ago

0.4.2

10 years ago

0.4.1

10 years ago

0.4.0

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.0.5

10 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.1

11 years ago