diff --git a/start.py b/start.py index 563ce7607..51d43991e 100644 --- a/start.py +++ b/start.py @@ -872,12 +872,12 @@ def process_uri(): username = data.get("userName") os.environ[SERVER_URL_ENV_KEY] = server_url - _connect_to_ayon_server(username=username) - variant = data["variant"] # Cleanup environemnt variables env = os.environ.copy() # Remove all possible clash env keys + # - removing 'AYON_API_KEY' removes option to have set + # the env variable globaly on machine for key in { "AYON_API_KEY", "AYON_USE_STAGING", @@ -885,6 +885,9 @@ def process_uri(): }: env.pop(key, None) + _connect_to_ayon_server(username=username) + variant = data["variant"] + # Set new environment variables based on information from server if variant == "staging": env["AYON_USE_STAGING"] = "1"