New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support ctx.state to pass user #57
Comments
Sounds good to me. What do you think, should we still keep it in |
Yeah I think that makes sense. I can put together a PR for this if you want |
A PR is of course highly welcome, but I am also totally fine with implementing it myself. |
I'd love to contribute. I'll take a stab at it and see what you think. |
Before I publish a new version I just like to get some feedback on the methods |
I tend to think of |
Thanks for your feedback! I agree on your points. I think |
Before you publish, I just discovered a problem with my implementation that could create a race condition. Basically, I'll fix in a new PR |
It appears that the I checked the stack trace:
So this deprecation notice is unavoidable it seems. Should I open a new issue? |
Thanks for reporting, I've created an issue for this: #66 |
I believe that best practice for koa v2 would be to store the authenticated user in
ctx.state
, rather thanctx.request
.Documentation for koa v2 indicates that
ctx.state
is "the recommended namespace for passing information through middleware ..."https://github.com/koajs/koa/blob/v2.x/docs/api/context.md#ctxstate
The text was updated successfully, but these errors were encountered: