Merge pull request #140 from VVX7/master

chg: [auth] conditionally send debug token
pull/145/head
Alexandre Dulaunoy 2019-12-20 21:54:58 +01:00 committed by GitHub
commit d0b9e05fe8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -113,7 +113,6 @@ class User(UserMixin):
"data[_Token][key]": "",
"data[_Token][fields]": "",
"data[_Token][unlocked]": "",
"data[_Token][debug]": "",
"data[User][email]": self.id,
"data[User][password]": self.password,
}
@ -140,7 +139,11 @@ class User(UserMixin):
post_data["data[_Token][fields]"] = token_fields.group(1)
post_data["data[_Token][key]"] = token_key.group(1)
post_data["data[_Token][debug]"] = token_debug.group(1)
# debug_token should return None when MISP debug is off.
# Only send debug_token when MISP is running in debug mode.
if token_debug is not None:
post_data["data[_Token][debug]"] = token_debug.group(1)
# POST request with user credentials + hidden form values.
post_to_login_page = session.post(misp_login_page, data=post_data, allow_redirects=False)