From 8dd060a5c20e18dea3a66cff420e20a66ac0a16f Mon Sep 17 00:00:00 2001 From: kemar Date: Thu, 25 Mar 2021 14:03:31 +0100 Subject: [PATCH] Fix `jwt.encode` because tokens are returned as string instead of a byte string --- itou/utils/apis/metabase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/itou/utils/apis/metabase.py b/itou/utils/apis/metabase.py index 17d74b6de5..f584904d00 100644 --- a/itou/utils/apis/metabase.py +++ b/itou/utils/apis/metabase.py @@ -10,7 +10,7 @@ # * https://github.com/jpadilla/pyjwt # * https://github.com/metabase/embedding-reference-apps/blob/master/django/embedded_analytics/user_stats/views.py def _get_token(payload): - return jwt.encode(payload, settings.METABASE_SECRET_KEY, algorithm="HS256").decode("utf8") + return jwt.encode(payload, settings.METABASE_SECRET_KEY, algorithm="HS256") def metabase_embedded_url(dashboard_id):