From 232354d2fe2915a7ab79f1b58bea3e09a986f79e Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Fri, 3 Dec 2021 15:40:25 +0100 Subject: [PATCH] feat(api): fixed null object --- ee/api/chalicelib/core/users.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ee/api/chalicelib/core/users.py b/ee/api/chalicelib/core/users.py index 4a26e5282..6187f1aa1 100644 --- a/ee/api/chalicelib/core/users.py +++ b/ee/api/chalicelib/core/users.py @@ -690,10 +690,11 @@ def authenticate_sso(email, internal_id, exp=None): RETURNING jwt_iat;""", {"user_id": r["id"]}) cur.execute(query) + r = cur.fetchone() return authorizers.generate_jwt(r['id'], r['tenantId'], - TimeUTC.datetime_to_timestamp(cur.fetchone()["jwt_iat"]), + TimeUTC.datetime_to_timestamp(r["jwt_iat"]), aud=f"front:{helper.get_stage_name()}", - exp=(exp + TimeUTC.datetime_to_timestamp(cur.fetchone()["jwt_iat"])) \ + exp=(exp + TimeUTC.datetime_to_timestamp(r["jwt_iat"])) \ if exp is not None else None) return None