Semaphore/lib/auth.js

13 lines
266 B
JavaScript
Raw Normal View History

2014-08-24 19:36:34 +02:00
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);
})