mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
Fix socket.io auth: Use connect to parse signed cookies (migrate to express v3)
This commit is contained in:
parent
0f436d5916
commit
0c9c1f514f
3 changed files with 20 additions and 10 deletions
|
@ -88,7 +88,7 @@ exports.basicAuth = function (req, res, next) {
|
|||
});
|
||||
}
|
||||
|
||||
var secret = null;
|
||||
exports.secret = null;
|
||||
|
||||
exports.expressConfigure = function (hook_name, args, cb) {
|
||||
// If the log level specified in the config file is WARN or ERROR the application server never starts listening to requests as reported in issue #158.
|
||||
|
@ -103,10 +103,10 @@ exports.expressConfigure = function (hook_name, args, cb) {
|
|||
|
||||
if (!exports.sessionStore) {
|
||||
exports.sessionStore = new express.session.MemoryStore();
|
||||
secret = randomString(32);
|
||||
exports.secret = randomString(32);
|
||||
}
|
||||
|
||||
args.app.use(express.cookieParser(secret));
|
||||
args.app.use(express.cookieParser(exports.secret));
|
||||
|
||||
args.app.sessionStore = exports.sessionStore;
|
||||
args.app.use(express.session({store: args.app.sessionStore,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue