Fix: Redirect loop on formkey or nonce mismatch.
* fix 401-302-401-302-429 loop * don't logout users on bad form key, just treat the request as unauthenticated * Handle None/empty case in validate_formkey. A supplied empty formkey, or the lack of a supplied formkey (None) is not a valid formkey. Handle this inside the function rather than at the call-site. * Validate as false if no hashstr or string Co-authored-by: Snakes <104547575+TLSM@users.noreply.github.com>
This commit is contained in:
parent
a213396854
commit
1ae3dc85c2
3 changed files with 11 additions and 8 deletions
|
@ -13,7 +13,7 @@ def generate_hash(string):
|
|||
|
||||
|
||||
def validate_hash(string, hashstr):
|
||||
|
||||
if not string or not hashstr: return False
|
||||
return hmac.compare_digest(hashstr, generate_hash(string))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue