Skip to content

Commit

Permalink
Merge pull request #52 from drscholly/fix/authv2
Browse files Browse the repository at this point in the history
Add authv2 token handling
  • Loading branch information
drscholly authored Oct 28, 2024
2 parents bb2a2ce + 0c406e8 commit 4aad491
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 4aad491

Please sign in to comment.