mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-12-25 14:37:02 +01:00
Dont convert to string when serializing
This commit is contained in:
parent
af00b66687
commit
0af45c5dca
@ -23,7 +23,7 @@ def after_request(response):
|
|||||||
if response.is_json:
|
if response.is_json:
|
||||||
session_copy = copy.deepcopy(dict(session))
|
session_copy = copy.deepcopy(dict(session))
|
||||||
data = response.get_json()
|
data = response.get_json()
|
||||||
data["session"] = serializer.dumps(json.dumps(session_copy))
|
data["session"] = serializer.dumps(session_copy)
|
||||||
response.set_data(json.dumps(data))
|
response.set_data(json.dumps(data))
|
||||||
return response
|
return response
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ def before_request():
|
|||||||
authorization = request.headers.get("authorization", None)
|
authorization = request.headers.get("authorization", None)
|
||||||
if authorization:
|
if authorization:
|
||||||
try:
|
try:
|
||||||
data = json.loads(serializer.loads(authorization))
|
data = serializer.loads(authorization)
|
||||||
session.update(data)
|
session.update(data)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
@ -107,7 +107,7 @@ def guild_embed(guild_id):
|
|||||||
def signin_complete():
|
def signin_complete():
|
||||||
sess = ""
|
sess = ""
|
||||||
session_copy = copy.deepcopy(dict(session))
|
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)
|
return render_template("signin_complete.html.j2", session=sess)
|
||||||
|
|
||||||
@embed.route("/login_discord")
|
@embed.route("/login_discord")
|
||||||
|
@ -20,7 +20,7 @@ class Gateway(Namespace):
|
|||||||
authorization = data.get("session", None)
|
authorization = data.get("session", None)
|
||||||
if authorization:
|
if authorization:
|
||||||
try:
|
try:
|
||||||
data = json.loads(serializer.loads(authorization))
|
data = serializer.loads(authorization)
|
||||||
session.update(data)
|
session.update(data)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user