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

CSRF Issue #72

Closed
filipebraida opened this issue May 11, 2024 · 1 comment
Closed

CSRF Issue #72

filipebraida opened this issue May 11, 2024 · 1 comment

Comments

@filipebraida
Copy link

filipebraida commented May 11, 2024

Package version

@japa/plugin-adonisjs ^3.0.1

Describe the bug

Firstly, I apologize if I am not posting in the correct place as it might be an error in the Adonis plugin for Japa.

I am migrating my project from V5 to V6 and encountered the following difficulty.

My application uses CSRF, auth, and method spoofing.

In all non-GET routes within the tests, an Invalid or expired CSRF token error was reported.

I tried to isolate the error and created a repository replicating the issue. When I disable CSRF protection, it works. I'm not sure if it's a misconfiguration or a real problem.

I found several small issues in this part of the Adonis documentation, such as missing imports in the examples or conflicting explanations.

Reproduction repo

https://github.com/filipebraida/adonis-csrf-test-problem

@filipebraida
Copy link
Author

I discovered the problem after a long time. I use zshrc with the dotenv plugin. In v5, Adonis would overwrite the environment variables that the plugin had loaded into memory. In v6, the priority was given to those that were in the terminal, and this would change the SESSION_DRIVER.

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

1 participant