Dont convert to string when serializing

This commit is contained in:
Jeremy Zhang 2020-11-30 15:23:30 -08:00
parent af00b66687
commit 0af45c5dca
3 changed files with 4 additions and 4 deletions

View File

@ -23,7 +23,7 @@ def after_request(response):
if response.is_json:
session_copy = copy.deepcopy(dict(session))
data = response.get_json()
data["session"] = serializer.dumps(json.dumps(session_copy))
data["session"] = serializer.dumps(session_copy)
response.set_data(json.dumps(data))
return response
@ -32,7 +32,7 @@ def before_request():
authorization = request.headers.get("authorization", None)
if authorization:
try:
data = json.loads(serializer.loads(authorization))
data = serializer.loads(authorization)
session.update(data)
except:
pass

View File

@ -107,7 +107,7 @@ def guild_embed(guild_id):
def signin_complete():
sess = ""
session_copy = copy.deepcopy(dict(session))
sess = serializer.dumps(json.dumps(session_copy))
sess = serializer.dumps(session_copy)
return render_template("signin_complete.html.j2", session=sess)
@embed.route("/login_discord")

View File

@ -20,7 +20,7 @@ class Gateway(Namespace):
authorization = data.get("session", None)
if authorization:
try:
data = json.loads(serializer.loads(authorization))
data = serializer.loads(authorization)
session.update(data)
except:
pass