lib/authentication/maintenance.js
function addSessionHandling(secrets, app) {
  var connection = dbUtils.getConnectionNow();

  var sessionStore = new MongoStore({
    db: connection.db
  });

  app.use(cookieParser());
  app.use(session({
    secret: secrets.cookieSecret,
    maxAge: 3600000, // 1 hour
    store: sessionStore
  }));

  app.use(passport.initialize());
  exports.usingSessions = true;
  app.use(passport.session());

  passport.serializeUser(function (user, done) {
    var data = user.data || user;
    done(null, {
      data: data,
      isAuthenticated: true,
      meta: {}
    });
  });

  passport.deserializeUser(function (obj, done) {
    done(null, obj);
  });
}
function addSessionHandling(secrets, app) {
  var connection = dbUtils.getConnectionNow();

  var sessionStore = new MongoStore({
    db: connection.db
  });

  app.use(cookieParser());
  app.use(session({
    secret: secrets.cookieSecret,
    maxAge: 3600000, // 1 hour
    store: sessionStore
  }));

  app.use(passport.initialize());
  exports.usingSessions = true;
  app.use(passport.session());

  passport.serializeUser(function (user, done) {
    var data = user.data || user;
    done(null, {
      data: data,
      isAuthenticated: true,
      meta: {}
    });
  });

  passport.deserializeUser(function (obj, done) {
    done(null, obj);
  });
}
function addSessionHandling ( secrets , app ) { var connection = dbUtils . getConnectionNow ( ) ; var sessionStore = new MongoStore ( { db : connection . db } ) ; app . use ( cookieParser ( ) ) ; app . use ( session ( { secret : secrets . cookieSecret , maxAge : 3600000 , // 1 hour store : sessionStore } ) ) ; app . use ( passport . initialize ( ) ) ; exports . usingSessions = true ; app . use ( passport . session ( ) ) ; passport . serializeUser ( function ( user , done ) { var data = user . data || user ; done ( null , { data : data , isAuthenticated : true , meta : { } } ) ; } ) ; passport . deserializeUser ( function ( obj , done ) { done ( null , obj ) ; } ) ; }
Adds the handling of session cookies.
Adds the handling of session cookies .