From 6c377bc4e57c169bbf56320b6b5d52c8670218e6 Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Fri, 10 Jun 2022 15:49:24 +0200 Subject: [PATCH] feat(api): fixed login response --- ee/api/chalicelib/core/users.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ee/api/chalicelib/core/users.py b/ee/api/chalicelib/core/users.py index 49081b12a..e5d5d17c9 100644 --- a/ee/api/chalicelib/core/users.py +++ b/ee/api/chalicelib/core/users.py @@ -668,7 +668,7 @@ def authenticate(email, password, for_change_password=False, for_plugin=False): r = helper.dict_to_camel_case(r) jwt_iat = change_jwt_iat(r['userId']) return { - "jwt": authorizers.generate_jwt(r['id'], r['tenantId'], + "jwt": authorizers.generate_jwt(r['userId'], r['tenantId'], TimeUTC.datetime_to_timestamp(jwt_iat), aud=f"plugin:{helper.get_stage_name()}" if for_plugin else f"front:{helper.get_stage_name()}"), "email": email, @@ -700,7 +700,7 @@ def authenticate_sso(email, internal_id, exp=None): if r is not None: r = helper.dict_to_camel_case(r) jwt_iat = TimeUTC.datetime_to_timestamp(change_jwt_iat(r['userId'])) - return authorizers.generate_jwt(r['id'], r['tenantId'], + return authorizers.generate_jwt(r['userId'], r['tenantId'], jwt_iat, aud=f"front:{helper.get_stage_name()}", exp=(exp + jwt_iat // 1000) if exp is not None else None) return None