From 45b8a23bb89714900c5c98bbdd4729075b5d7cfb Mon Sep 17 00:00:00 2001 From: Kraiem Taha Yassine Date: Fri, 9 Aug 2024 15:37:49 +0200 Subject: [PATCH] Dev (#2478) * refactor(chalice): upgraded dependencies * refactor(chalice): upgraded dependencies feat(chalice): support heatmaps * fix(chalice): fixed Math-operators validation refactor(chalice): search for sessions that have events for heatmaps * refactor(chalice): search for sessions that have at least 1 location event for heatmaps * refactor(chalice): upgraded dependencies * refactor(chalice): upgraded dependencies feat(chalice): support heatmaps * fix(chalice): fixed Math-operators validation refactor(chalice): search for sessions that have events for heatmaps * refactor(chalice): search for sessions that have at least 1 location event for heatmaps * refactor(chalice): upgraded dependencies refactor(crons): upgraded dependencies refactor(alerts): upgraded dependencies * feat(chalice): get top 10 values for autocomplete CH * refactor(chalice): cleaned code refactor(chalice): upgraded dependencies refactor(alerts): upgraded dependencies refactor(crons): upgraded dependencies * feat(chalice): autocomplete return top 10 with stats * fix(chalice): fixed autocomplete top 10 meta-filters * fix(chalice): fixed Spot token generation --- api/chalicelib/core/users.py | 5 +++-- ee/api/chalicelib/core/users.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/api/chalicelib/core/users.py b/api/chalicelib/core/users.py index d13353a1c..e520633fb 100644 --- a/api/chalicelib/core/users.py +++ b/api/chalicelib/core/users.py @@ -647,12 +647,13 @@ def authenticate(email, password, for_change_password=False, include_spot=False) response = { **response, "spotJwt": authorizers.generate_jwt(user_id=r['userId'], tenant_id=r['tenantId'], - iat=j_r.spot_jwt_iat, aud=spot.AUDIENCE), + iat=j_r.spot_jwt_iat, aud=spot.AUDIENCE, for_spot=True), "spotRefreshToken": authorizers.generate_jwt_refresh(user_id=r['userId'], tenant_id=r['tenantId'], iat=j_r.spot_jwt_refresh_iat, aud=spot.AUDIENCE, - jwt_jti=j_r.spot_jwt_refresh_jti), + jwt_jti=j_r.spot_jwt_refresh_jti, + for_spot=True), "spotRefreshTokenMaxAge": config("JWT_SPOT_REFRESH_EXPIRATION", cast=int) } return response diff --git a/ee/api/chalicelib/core/users.py b/ee/api/chalicelib/core/users.py index ef54bf24c..35afa6576 100644 --- a/ee/api/chalicelib/core/users.py +++ b/ee/api/chalicelib/core/users.py @@ -759,12 +759,13 @@ def authenticate(email, password, for_change_password=False, include_spot=False) if include_spot: response = {**response, "spotJwt": authorizers.generate_jwt(user_id=r['userId'], tenant_id=r['tenantId'], - iat=j_r.spot_jwt_iat, aud=spot.AUDIENCE), + iat=j_r.spot_jwt_iat, aud=spot.AUDIENCE, for_spot=True), "spotRefreshToken": authorizers.generate_jwt_refresh(user_id=r['userId'], tenant_id=r['tenantId'], iat=j_r.spot_jwt_refresh_iat, aud=spot.AUDIENCE, - jwt_jti=j_r.spot_jwt_refresh_jti), + jwt_jti=j_r.spot_jwt_refresh_jti, + for_spot=True), "spotRefreshTokenMaxAge": config("JWT_SPOT_REFRESH_EXPIRATION", cast=int), } return response