-
Notifications
You must be signed in to change notification settings - Fork 112
csrf errors #31
Comments
Can you check the requests and see if it's showing the X-CSRF (or whatever its labeled) header in them? Also see if it's setting the csrf cookie on the initial gargoyle page load. |
The X-CSRFToken is set in the headers. Django is setting the csrf cookie, however I am using a custom name: |
And it's sending the token header (with the ajax call) as the correct value of the cookie? Are you behind SSL? |
hrmpf. Today the token header isn't being included so I can't check. No SSL atm, and I'm on localhost. Well, I'll revisit it next week. |
Just to resurrect this issue: this happens when you set a custom CSRF_COOKIE_NAME. In our websites we have the following configuration: default cookie name for production environment ( Gargoyle request:
One of our (patched) requests:
What we did is just to edit the code at https://docs.djangoproject.com/en/dev/ref/contrib/csrf/#ajax replacing the CSRF cookie name in Hope this issue will be fixed soon, gargoyle is an essential part of our infrastructure, and not being able to use it properly in our testing environment is kinda problematic. |
+1 |
Tried installing gargoyle 0.6.1 with nexus 0.2.3 and none of the ajax links work for managing switches, due to the standard csrf errors. 403 forbidden CSRF verification failed. Request aborted.
The recent nexus commits to use ajaxSetup are being called correctly, but something (I've no idea what) is not working with gargoyles provided templates and staticfiles.
The text was updated successfully, but these errors were encountered: