Skip to content

Commit

Permalink
Fix read of env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanhellander committed Feb 23, 2024
1 parent dc2dea6 commit 1014f52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fedn/fedn/network/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(self, host, port=None, secure=False, verify=False, token=None, verb
self.verify = verify
self.header = {}
# Check if auth token is set by environment variable
env_token = os.environ("FEDN_AUTH_TOKEN", False)
env_token = os.environ.get("FEDN_AUTH_TOKEN", False)
if env_token:
self.header = {"Authorization": "Token {}".format(token)}
# Override potential env variable if token is passed as argument.
Expand Down

0 comments on commit 1014f52

Please sign in to comment.