Skip to content

Commit

Permalink
fix(server): only enable sessions if twitter oauth was selected
Browse files Browse the repository at this point in the history
  • Loading branch information
DaftMonk committed Jul 4, 2014
1 parent 8a2249f commit bcd00dc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/templates/server/config/express.js
Expand Up @@ -14,7 +14,7 @@ var cookieParser = require('cookie-parser');
var errorHandler = require('errorhandler');
var path = require('path');
var config = require('./environment');<% if (filters.auth) { %>
var passport = require('passport');
var passport = require('passport');<% } %><% if (filters.twitterAuth) { %>
var session = require('express-session');
var mongoStore = require('connect-mongo')(session);<% } %>

Expand All @@ -29,9 +29,10 @@ module.exports = function(app) {
app.use(bodyParser());
app.use(methodOverride());
app.use(cookieParser());
<% if (filters.auth) { %>app.use(passport.initialize());<% } %><% if (filters.auth) { %>
<% if (filters.auth) { %>app.use(passport.initialize());<% } %><% if (filters.twitterAuth) { %>

// Persist sessions with mongoStore
// We need to enable sessions for passport twitter because its an oauth 1.0 strategy
app.use(session({
secret: config.secrets.session,
store: new mongoStore({
Expand Down

0 comments on commit bcd00dc

Please sign in to comment.