Merge pull request #26090 from tlaziuk/koa-session

[koa-session] restore ability to reset the session
This commit is contained in:
Benjamin Lichtman
2018-05-31 15:38:48 -07:00
committed by GitHub
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -213,7 +213,7 @@ declare function session(app: Koa): Koa.Middleware;
declare module "koa" {
interface Context {
session: session.Session | undefined;
session: session.Session | null;
readonly sessionOptions: session.opts | undefined;
}
+7
View File
@@ -39,4 +39,11 @@ app.use(session({
},
}, app));
app.use((ctx, next) => {
// reset the session
ctx.session = null;
return next();
});
app.listen(3000);