about summary refs log tree commit diff
path: root/gn2/wqflask/oauth2
diff options
context:
space:
mode:
Diffstat (limited to 'gn2/wqflask/oauth2')
-rw-r--r--gn2/wqflask/oauth2/client.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/gn2/wqflask/oauth2/client.py b/gn2/wqflask/oauth2/client.py
index 8feb9c7f..c16b705d 100644
--- a/gn2/wqflask/oauth2/client.py
+++ b/gn2/wqflask/oauth2/client.py
@@ -58,7 +58,8 @@ def __no_token__(_err) -> Left:
     resp.status_code = 400
     return Left(resp)
 
-def oauth2_get(uri_path: str, data: dict = {}, **kwargs) -> Either:
+def oauth2_get(uri_path: str, data: dict = {},
+               jsonify_p: bool = False, **kwargs) -> Either:
     def __get__(token) -> Either:
         client = OAuth2Session(
             oauth2_clientid(), oauth2_clientsecret(),
@@ -68,6 +69,8 @@ def oauth2_get(uri_path: str, data: dict = {}, **kwargs) -> Either:
             data=data,
             **kwargs)
         if resp.status_code == 200:
+            if jsonify_p:
+                return Right(resp)
             return Right(resp.json())
 
         return Left(resp)