From db5bf061e00f6e394bfc3d9774a51947d5e44c23 Mon Sep 17 00:00:00 2001 From: Kraiem Taha Yassine Date: Fri, 30 Aug 2024 16:37:40 +0200 Subject: [PATCH] Dev (#2521) * 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 * 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 * feat(chalice): autocomplete return top 10 with stats * fix(chalice): fixed autocomplete top 10 meta-filters * fix(chalice): fix spot refresh --- api/chalicelib/core/spot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/chalicelib/core/spot.py b/api/chalicelib/core/spot.py index 9adeccdea..4dab51a41 100644 --- a/api/chalicelib/core/spot.py +++ b/api/chalicelib/core/spot.py @@ -29,14 +29,14 @@ def refresh(user_id: int, tenant_id: int = -1) -> dict: spot_jwt_iat, spot_jwt_r_jti, spot_jwt_r_iat = refresh_spot_jwt_iat_jti(user_id=user_id) return { "jwt": authorizers.generate_jwt(user_id=user_id, tenant_id=tenant_id, iat=spot_jwt_iat, - aud=AUDIENCE), + aud=AUDIENCE, for_spot=True), "refreshToken": authorizers.generate_jwt_refresh(user_id=user_id, tenant_id=tenant_id, iat=spot_jwt_r_iat, - aud=AUDIENCE, jwt_jti=spot_jwt_r_jti), + aud=AUDIENCE, jwt_jti=spot_jwt_r_jti, for_spot=True), "refreshTokenMaxAge": config("JWT_SPOT_REFRESH_EXPIRATION", cast=int) - (spot_jwt_iat - spot_jwt_r_iat) } -def refresh_auth_exists(user_id, jwt_jti=None): +def refresh_auth_exists(user_id, jwt_jti): with pg_client.PostgresClient() as cur: cur.execute( cur.mogrify(f"""SELECT user_id