mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-18 22:44:24 +01:00
Remove keys from session and inject Session class into Jinja (#1456)
* Closes #1362 * Reduces the session object to just an id, nonce, and security hash
This commit is contained in:
@@ -144,9 +144,8 @@ def register_user(
|
||||
if raise_for_error:
|
||||
with client.session_transaction() as sess:
|
||||
assert sess["id"]
|
||||
assert sess["name"] == name
|
||||
assert sess["email"]
|
||||
assert sess["nonce"]
|
||||
assert sess["hash"]
|
||||
|
||||
|
||||
def register_team(app, name="team", password="password", raise_for_error=True):
|
||||
@@ -171,9 +170,8 @@ def login_as_user(app, name="user", password="password", raise_for_error=True):
|
||||
if raise_for_error:
|
||||
with client.session_transaction() as sess:
|
||||
assert sess["id"]
|
||||
assert sess["name"]
|
||||
assert sess["email"]
|
||||
assert sess["nonce"]
|
||||
assert sess["hash"]
|
||||
return client
|
||||
|
||||
|
||||
@@ -229,9 +227,8 @@ def login_with_mlc(
|
||||
if raise_for_error:
|
||||
with client.session_transaction() as sess:
|
||||
assert sess["id"]
|
||||
assert sess["name"]
|
||||
assert sess["email"]
|
||||
assert sess["nonce"]
|
||||
assert sess["hash"]
|
||||
return client
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user