Skip to content
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

Add csrf token in ctx.state #50

Closed
hvintik opened this issue Dec 25, 2019 · 4 comments
Closed

Add csrf token in ctx.state #50

hvintik opened this issue Dec 25, 2019 · 4 comments

Comments

@hvintik
Copy link

hvintik commented Dec 25, 2019

Screenshot 2019-12-25 at 16 25 30

ctx.state is a recommended namespace for passing information through middleware and to your frontend views.

@hvintik hvintik changed the title Add crsf token in ctx.state Add csrf token in ctx.state Dec 25, 2019
@titanism
Copy link
Contributor

titanism commented Jul 1, 2022

This will be resolved in v4.0.0 released to npm later today

@titanism titanism closed this as completed Jul 1, 2022
@titanism
Copy link
Contributor

titanism commented Jul 1, 2022

Released koa-csrf v4.0.0, which requires Node >= 14.

https://github.com/koajs/csrf/releases/tag/v4.0.0

@titanism
Copy link
Contributor

titanism commented Jul 2, 2022

Actually, we're deprecating v4.0.0 and just released v4.0.1. All the "getter" internals need rewritten to actually support "ctx.state.csrf" properly.

titanism added a commit that referenced this issue Jul 2, 2022
@titanism
Copy link
Contributor

titanism commented Jul 2, 2022

v5.0.0 is released which strictly and only supports ctx.state._csrf 🎉

Note we also added errorHandler function option. See the notice at the top of the README or view the releases tab for more insight:

https://github.com/koajs/csrf/releases/tag/v5.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants