[ This is not an issue per se, more of a question. I did not find any other place to ask it, sorry if there is a better place for that (I'd gladly repost it elsewhere if needed, of course.) ]
I am using koa-mongo and koa-passport. Passport requires to provide the function deserializeUser(), which needs access to the database. But it is defined outside of a middleware, and has no access to ctx. And the MongoClient is made available on ctx.
Is there another way to access the mongo client? Maybe at the Koa app level?
Hi,
[ This is not an issue per se, more of a question. I did not find any other place to ask it, sorry if there is a better place for that (I'd gladly repost it elsewhere if needed, of course.) ]
I am using
koa-mongo
andkoa-passport
. Passport requires to provide the functiondeserializeUser()
, which needs access to the database. But it is defined outside of a middleware, and has no access toctx
. And theMongoClient
is made available onctx
.Is there another way to access the mongo client? Maybe at the Koa
app
level?Thank you!