-
Notifications
You must be signed in to change notification settings - Fork 156
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
[BUG] Middleware doesn't work with Chi #173
Labels
Comments
Hi @romanian-bag-void, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there an existing issue for this?
Current Behavior
Looks like a bug to me, but I hope I'm not missing something. I don't know if this is a Chi-related issue, or gorilla-csrf issue.
I'm trying to use chi with the CSRF middleware, but for some reason, despite it being easy to access the token, on protected routes they don't appear. I understand how the whole CSRF process should work usually, and have read the docs, but I don't seem to be able to create protected routes. In my particular case, I want to get the CSRF token as a JSON attribute, but I think that is redundant in this case.
Expected Behavior
CSRF-protected routes should require the token in some form to be accessible and give a 403 Forbidden error if they are not provided the token.
Steps To Reproduce
Create a default middleware, apply it to the router, apply it to individual routes, doesn't work. Doesn't work on groups either.
Anything else?
The code:
`
`
The text was updated successfully, but these errors were encountered: