Purpose of token length check against CSRF_SECRET_LENGTH? #2073
Closed
scott2b
started this conversation in
Potential Issues
Replies: 3 comments 3 replies
-
Can you provide a reproduction of the failure? |
Beta Was this translation helpful? Give feedback.
2 replies
-
issue opened. Pls use the issue for tracking. We'll get to it in the next few days. |
Beta Was this translation helpful? Give feedback.
1 reply
-
It turns out that this issue is happening for me specific to Chrome and specific to when I request via |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
In reference to this code in the CSRF middleware
Perhaps someone can explain the purpose of this length check? And maybe if it is somehow affected by configuration or settings? I have been unable to get CSRF working -- it consistently fails despite having matching tokens between the form and cookie -- and as best as I can tell, this check of the token length is the culprit. For both the form token, and the cookie,
_decode_csrf_token
is returning None, and_csrf_tokens_match
is returning False despite being equivalent strings.Here is my pdb session for reference:
I appreciate any help on this. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions