diff --git a/api/chalicelib/core/users.py b/api/chalicelib/core/users.py index d13353a1c4..e520633fbc 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 ef54bf24ce..35afa65765 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