IVS-593 - Users are unable to self report vendor association#209
Conversation
|
Isn't the issue simply this single line change: https://github.com/buildingSMART/validate/blame/development/backend/apps/ifc_validation_bff/views_legacy.py#L206 from |
Before this change we had a mix of methods either not checking the token (on POST to This PR change now: always sets the cookie with each API request (@ensure_csrf_cookie) and always validates them (@requires_csrf_token) for modifying HTTP verbs (POST, DELETE, PUT etc). |
That's exactly my question. In this sense I find the django docs vague and badly named, but according to my long term memory requires_csrf_token does not validate, but only provides the token to the template context. Maybe
Not entirely sure what This decorator works similarly to csrf_protect, but never rejects an incoming request. means, but never rejects an incoming request does not sound like it validates. Not sure why it's similar to csrf_protect then though... |
This is my interpretation how it works (and I agree, Django docs are not conclusive)
I updated the PR to be more selective about it and to switch |
Ghesselink
left a comment
There was a problem hiding this comment.
Manual check & e2e tests are all passing
Impacts new users or users who have cleared their cookies
(added Playwright tests that were failing before the fix)