Replies: 1 comment 1 reply
-
|
I think I've stumbled onto the solution for this problem, at least in my situation. After I did the following, the error went away:
Example config function in a controller other than THE Controller.cfc: I still would like to hear responses to Steps 3-5 with examples above. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I had this buried in another thread and decided it should be it's own thread.
I have a buttonTo() for a button that is to log out the user. I specify the route name "/logout" and the method "DELETE". This renders a form tag with method POST to /logout action. Inside the form tag wrapper is a hidden input for _method DELETE and a button tag for the logout.
In the Sessions controller is a logout action method. The /logout route maps to sessions.logout. So all is wired as it should be, AFAIK. When clicking the button in the app, it throws an error:
After some searching the internet I came upon brief mention about cross-site request forgery csrf projection. I then tried to find directions how to configure an app to provide the protection. I could only find a brief 5 step list of what to do. First 2 steps were pretty straight forward. but steps 3-5 were not so clear. No examples were given to understand and learn from. Here is the article that references the problem I believe I'm encountering:
https://groups.google.com/g/cfwheels/c/m8E3MKUz7A8
Here is the brief list of 5 steps:
https://guides.cfwheels.org/cfwheels-guides/introduction/upgrading#cross-site-request-forgery-csrf-protection
Can someone please help me understand how to do steps 3-5?
Step 3: How do you do it? Example would be helpful.
Step 4: What is meant by updating route definitions?
Step 5. In my example above, my buttonTo is setting the route and method to delete. So What is Step 5 wanting done?
Beta Was this translation helpful? Give feedback.
All reactions