From 1afe81c7fb87d99a422d4705a99d7494afaa58c0 Mon Sep 17 00:00:00 2001 From: JargeZ Date: Fri, 26 Jul 2024 11:47:39 +1000 Subject: [PATCH] Assert on token format caused by inconsistency with authlib --- xero_python/api_client/oauth2.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xero_python/api_client/oauth2.py b/xero_python/api_client/oauth2.py index ca7aab20..8d913909 100644 --- a/xero_python/api_client/oauth2.py +++ b/xero_python/api_client/oauth2.py @@ -294,6 +294,9 @@ def update_token( self.expires_in = expires_in self.id_token = id_token self.refresh_token = refresh_token + assert isinstance(scope, (list, tuple)), ( + "Scope must be list or tuple, please split it if you are using authlib for initial login" + ) self.scope = scope self.token_type = token_type