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

Fix CSRF InvalidAuthenticityToken #86

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cprodhomme
Copy link
Contributor

No description provided.

@zorab47
Copy link
Owner

zorab47 commented Feb 22, 2020

Any worries of raising JS errors if that attribute is missing? How do other plugins solve this problem?

@cprodhomme
Copy link
Contributor Author

many people speak about put this line skip_before_filter :verify_authenticity_token into their controller but it's a huge mistake because the authenticity token is a random value generated in your view to prove a request is submitted from a form on your site, not somewhere else. This protects against CSRF attacks.

maybe, you need to check before the value $('meta[name=csrf-token]') is not null 🤔

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

Successfully merging this pull request may close these issues.

None yet

2 participants