Secbone / koa-session2

Middleware for Koa2 to get/set session
MIT License
153 stars 30 forks source link

Pass the context object to the store actions? #37

Closed knilink closed 7 years ago

knilink commented 7 years ago

Most of the times other middlewares may have already setup external store in the context. It will be very convenient if the session store can directly access these resources. For example

get(sid, ctx) {
  return ctx.db.session.findOne({sid})
}
Secbone commented 7 years ago

That's a good idea! I think it is easy to pass the context to the session store, and I will do it soon. Thanks! 😄