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
|
@ -366,7 +366,7 @@ class User(Base):
|
|||
return generate_hash(msg)
|
||||
|
||||
def validate_formkey(self, formkey):
|
||||
|
||||
if not formkey: return False
|
||||
return validate_hash(f"{session['session_id']}+{self.id}+{self.login_nonce}", formkey)
|
||||
|
||||
@property
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue