From 924547f5514316103334479337a5e8975ba46d75 Mon Sep 17 00:00:00 2001 From: Kraiem Taha Yassine Date: Fri, 30 Aug 2024 15:58:51 +0200 Subject: [PATCH] Dev (#2520) * 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 * debug(chalice): debugging spot login/refresh --- api/chalicelib/core/authorizers.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/api/chalicelib/core/authorizers.py b/api/chalicelib/core/authorizers.py index e4c9de352..1e1462d0b 100644 --- a/api/chalicelib/core/authorizers.py +++ b/api/chalicelib/core/authorizers.py @@ -17,10 +17,7 @@ def get_supported_audience(): def is_spot_token(token: str) -> bool: try: decoded_token = jwt.decode(token, options={"verify_signature": False, "verify_exp": False}) - logger.info("---- is spot token ----") - logger.info(decoded_token) audience = decoded_token.get("aud") - logger.info(f"{audience} == {spot.AUDIENCE} = {audience == spot.AUDIENCE}") return audience == spot.AUDIENCE except jwt.InvalidTokenError: logger.error(f"Invalid token for is_spot_token: {token}") @@ -52,7 +49,7 @@ def jwt_refresh_authorizer(scheme: str, token: str): try: payload = jwt.decode(jwt=token, key=config("JWT_REFRESH_SECRET") if not is_spot_token(token) \ - else config("JWT_SPOT_SECRET"), + else config("JWT_SPOT_REFRESH_SECRET"), algorithms=config("jwt_algorithm"), audience=get_supported_audience()) except jwt.ExpiredSignatureError: