diff --git a/csrf/app.js b/csrf/app.js index 6aba701..c2728e7 100644 --- a/csrf/app.js +++ b/csrf/app.js @@ -11,7 +11,7 @@ var app = module.exports = koa(); */ app.keys = ['session key', 'csrf example']; -app.use(session()); +app.use(session(app)); /** * maybe a bodyparser diff --git a/flash-messages/app.js b/flash-messages/app.js index df2b606..1dcaa2f 100644 --- a/flash-messages/app.js +++ b/flash-messages/app.js @@ -11,8 +11,7 @@ var app = module.exports = koa(); // required for signed cookie sessions app.keys = ['key1', 'key2']; - -app.use(session()); +app.use(session(app)); app.use(function *(next){ if (this.method !== 'GET' || this.path !== '/messages') return yield next; @@ -41,4 +40,4 @@ app.use(function *(next){ this.status = 204; }) -if (!module.parent) app.listen(3000); \ No newline at end of file +if (!module.parent) app.listen(3000); diff --git a/package.json b/package.json index bfc9b2f..ccf3912 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "koa-csrf": "^2.1.1", "koa-logger": "^1.2.1", "koa-route": "^1.1.4", - "koa-session": "^2.0.0", + "koa-session": "^3.1.0", "koa-static": "^1.4.5", "raw-body": "^1.2.1", "save-to": "^1.0.3",