Skip to content

Commit

Permalink
Merge pull request #51 from oroce/sessionstore
Browse files Browse the repository at this point in the history
Remove connect-mongodb, use connect-mongoskin to reuse connection
  • Loading branch information
osoner committed Feb 17, 2013
2 parents a152d62 + 5ed9f3e commit 2659f74
Show file tree
Hide file tree
Showing 589 changed files with 36,820 additions and 41,058 deletions.
2 changes: 1 addition & 1 deletion bin/updateCollections.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// Force logout all users since during login each user will be assigned an api_key
db.user_sessions.remove();
db.sessions_.remove();
10 changes: 3 additions & 7 deletions frontend/express/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var http = require('http'),
express = require('express'),
mongoStore = require('connect-mongodb'),
SkinStore = require('connect-mongoskin'),
expose = require('express-expose'),
mongo = require('mongoskin'),
crypto = require('crypto'),
Expand All @@ -10,11 +10,7 @@ var http = require('http'),
countlyMail = require('../../api/parts/mgmt/mail.js'),
countlyStats = require('../../api/parts/data/stats.js'),
countlyConfig = require('./config'),
countlyDb = mongo.db(countlyConfig.mongodb.host + ':' + countlyConfig.mongodb.port + '/' + countlyConfig.mongodb.db + '?auto_reconnect'),
Db = require('mongodb').Db,
Server = require('mongodb').Server,
server_config = new Server(countlyConfig.mongodb.host, countlyConfig.mongodb.port, {auto_reconnect:true, native_parser:true}),
sessionDb = new Db(countlyConfig.mongodb.db, server_config, {});
countlyDb = mongo.db(countlyConfig.mongodb.host + ':' + countlyConfig.mongodb.port + '/' + countlyConfig.mongodb.db + '?auto_reconnect');

function sha1Hash(str, addSalt) {
var salt = (addSalt) ? new Date().getTime() : "";
Expand Down Expand Up @@ -70,7 +66,7 @@ app.configure(function () {
app.use(express.cookieParser());
app.use(express.session({
secret:'countlyss',
store:new mongoStore({db:sessionDb, collection:'user_sessions'})
store:new SkinStore(countlyDb)
}));
app.use(express.methodOverride());
app.use(express.csrf());
Expand Down
6 changes: 0 additions & 6 deletions frontend/express/node_modules/connect-mongodb/Makefile

This file was deleted.

69 changes: 0 additions & 69 deletions frontend/express/node_modules/connect-mongodb/Readme.md

This file was deleted.

59 changes: 0 additions & 59 deletions frontend/express/node_modules/connect-mongodb/example/index.js

This file was deleted.

1 change: 0 additions & 1 deletion frontend/express/node_modules/connect-mongodb/index.js

This file was deleted.

188 changes: 0 additions & 188 deletions frontend/express/node_modules/connect-mongodb/lib/connect-mongodb.js

This file was deleted.

This file was deleted.

Loading

0 comments on commit 2659f74

Please sign in to comment.