- update dependencies
- fix #36 #29
- update lockit-sendmail with nodemailer 1.x
- update dependencies
- fix bug where different lockit instances share the same config object
- update dependencies
- add events
'forgot::sent'and'forgot::success' - update dependencies
- expose db adapter as
lockit.adapter - allow usage of custom db adapter (fix #15)
- use
utils.pipemethod for event piping - update dependencies
- add tests for event emitter
-
requires Express 4.x
-
makes use of
express.Router(). No need to passapparound as an argument.old
var Lockit = require('lockit'); var lockit = new Lockit(app, config);
new
var Lockit = require('lockit'); var lockit = new Lockit(config); app.use(lockit.router);
Listening on events stays the same.
lockit.on('login', function(user, res, target) { res.send('Welcome ' + user.name); })
-
proper Error handling. All Errors are piped to next middleware.
old
if (err) console.log(err);
new
if (err) return next(err);
Make sure you have some sort of error handling middleware at the end of your routes (is included by default in Express 4.x apps if you use the
express-generator). -
database configuration is a single object
old
// database settings for CouchDB exports.db = 'http://127.0.0.1:5984/test'; // or if you want to use MongoDB // exports.db = 'mongodb://127.0.0.1/test'; // exports.dbCollection = 'users';
new
// database settings for CouchDB exports.db = { url: 'http://127.0.0.1:5984/' // important: no db at the end } // you can still use the short notation for CouchDB // because CouchDB doesn't need 'name' and 'collection' // exports.db = 'http://127.0.0.1:5984/'; // or if you want to use MongoDB (SQL is similar) // exports.db = { // url: 'mongodb://127.0.0.1/', // name: 'test', // collection: 'users' // }
- username (
name) has to be lowercase and has to start with a letter
-
per-user database with
_securitydocument in CouchDB with all users in_usersdatabase -
add support for optional
request_defaults(used by lockit-couchdb-adapter)exports.request_defaults = { // proxy: 'http://someproxy' };
-
usernamebecomesname -
improve
restconfig settingseither
exports.rest = false; // default setting
or
exports.rest = { // set starting page for single page app index: 'public/index.html', // use view engine (render()) or send static file (sendfile()) useViewEngine: false }
-
add
exports.restIndexPage = 'public/index.html'to default configYou are now able to specify the starting page for your single page application. It defaults to
public/index.html. The path is relative to yourapp.js. You can also choose a.jadefileexports.restIndexPage = 'main.jade'. The path for the.jadefile is relative to the folder you've set viaapp.set('views', __dirname + '/views')(in this case theviews/folder).
...
- replace xtend by node.extend to allow for nested object in default config
- drop
dbUrland only usedbinconfig.jsfor connection string - drop
titlefrom email messages and usesubjectinstead - get type of database and lockit adapter from db connection string
- enable custom views