Skip to content
Snippets Groups Projects
Commit 8a263743 authored by Agate's avatar Agate :speech_balloon:
Browse files

Support for Bearer application token

parent eeb60fa7
No related branches found
No related tags found
No related merge requests found
......@@ -78,7 +78,8 @@ class API(object):
full_url = self.base_url + path
headers = kwargs.setdefault("headers", {})
if self.token:
headers["Authorization"] = "JWT {}".format(self.token)
scheme = "JWT" if len(self.token) > 50 else "Bearer"
headers["Authorization"] = " ".join([scheme, self.token])
handler = getattr(self._session, method)
return handler(full_url, *args, **kwargs)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment