Skip to content

Commit

Permalink
Add authv2 token handling
Browse files Browse the repository at this point in the history
  • Loading branch information
drscholly committed Oct 25, 2024
1 parent bb2a2ce commit 0c406e8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion toolbox/api/datagalaxy_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@ def get_client_space_id(self) -> str:
options={"verify_signature": False},
algorithms=["HS256"]
)
client_space_id = decode_token["cid"]
# old auth
if "cid" in decode_token:
client_space_id = decode_token["cid"]
# authv2
elif "dg_client_id" in decode_token:
client_space_id = decode_token["dg_client_id"]
else:
raise Exception('Error while decoding the token')

return client_space_id


Expand Down

0 comments on commit 0c406e8

Please sign in to comment.