fix auth (#20)

This commit is contained in:
Paulo Coutinho 2023-02-10 13:44:08 -03:00 committed by GitHub
parent f953d6723c
commit efe4bd8f67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,12 +68,9 @@ class Client:
if self.auth_store.token and ( if self.auth_store.token and (
"headers" not in config or "Authorization" not in config["headers"] "headers" not in config or "Authorization" not in config["headers"]
): ):
auth_type = "Admin"
if hasattr(self.auth_store.model, "verified"):
auth_type = "User"
config["headers"] = config.get("headers", {}) config["headers"] = config.get("headers", {})
config["headers"].update( config["headers"].update(
{"Authorization": f"{auth_type} {self.auth_store.token}"} {"Authorization": self.auth_store.token}
) )
# build url + path # build url + path
url = self.build_url(path) url = self.build_url(path)