Semaphore/lib/auth.js
2014-08-24 18:36:34 +01:00

13 lines
266 B
JavaScript

var passport = require('passport')
, models = require('./models')
, bugsnag = require('bugsnag')
passport.serializeUser(function(user, done) {
done(null, user._id);
});
passport.deserializeUser(function(id, done) {
models.User.findOne({
_id: id
}, done);
})