mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 07:47:04 +00:00
Merge pull request #26090 from tlaziuk/koa-session
[koa-session] restore ability to reset the session
This commit is contained in:
Vendored
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,4 +39,11 @@ app.use(session({
|
||||
},
|
||||
}, app));
|
||||
|
||||
app.use((ctx, next) => {
|
||||
// reset the session
|
||||
ctx.session = null;
|
||||
|
||||
return next();
|
||||
});
|
||||
|
||||
app.listen(3000);
|
||||
|
||||
Reference in New Issue
Block a user