Diffstat (limited to 'backend/node/src/clipperz.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | backend/node/src/clipperz.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/backend/node/src/clipperz.js b/backend/node/src/clipperz.js index 04b054a..c51b0bc 100644 --- a/backend/node/src/clipperz.js +++ b/backend/node/src/clipperz.js @@ -1,22 +1,22 @@ var FS = require('fs'); var CRYPTO = require('crypto'); var BIGNUM = require('bignum'); var ASYNC = require('async'); -var express_store = require('express').session.Store; +var express_store = require('express-session').Store; function clipperz_hash(v) { return CRYPTO.createHash('sha256').update( CRYPTO.createHash('sha256').update(v).digest('binary') ).digest('hex'); }; function clipperz_random() { for(var r = '';r.length<64;r+=''+BIGNUM(Math.floor(Math.random()*1e18)).toString(16)); return r.substr(0,64); }; function clipperz_store(PG) { var rv = function(o) { express_store.call(this,o); } rv.prototype.get = function(sid,cb) { PG.Q( "SELECT s_data FROM clipperz.thesession WHERE s_id=$1",[sid], function(e,r) { cb(e,(e||!r.rowCount)?null:JSON.parse(r.rows[0].s_data)); } ) }; |