Skip to content

Commit

Permalink
adding some debug code to see why connect-mongo is failing to retriev…
Browse files Browse the repository at this point in the history
…e session on heroku only
  • Loading branch information
btouellette committed Sep 14, 2015
1 parent 8083451 commit 3c1aad4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions app/gameserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ module.exports = function(server, sessionStore) {
return;
}
User.findById(session.passport.user, function(err, currentUser) {
if(err) {
console.log("user retrieval failed - error: " + err);
}
if(userToSocket[currentUser._id]) {
userToSocket[currentUser._id].push(socket);
} else {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"passport-twitter": "~1.0.2",
"passport-google-oauth": "~0.1.5",
"connect-flash": "~0.1.1",
"connect-mongo": "~0.4.1",
"connect-mongo": "~0.8.2",
"bcrypt-nodejs": "latest",
"tunnel": "0.0.3",
"socket.io": "~1.0.6",
Expand Down
2 changes: 1 addition & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var MongoStore = require('connect-mongo')(session);
// https://github.com/kcbanner/connect-mongo/issues/80
var sessionStore = new MongoStore({
url: configDB.url,
autoReconnect: true
auto_reconnect: true
});

mongoose.connect(configDB.url); // connect to our database
Expand Down

0 comments on commit 3c1aad4

Please sign in to comment.