@@ -88,11 +88,6 @@ public Assistant()
8888 var credentialsPaths = Utility . GetCredentialsPaths ( ) ;
8989 if ( credentialsPaths . Count > 0 )
9090 {
91- string ApiKey = "" ;
92- string Endpoint = "" ;
93- string Username = "" ;
94- string Password = "" ;
95-
9691 foreach ( string path in credentialsPaths )
9792 {
9893 if ( Utility . LoadEnvFile ( path ) )
@@ -101,15 +96,9 @@ public Assistant()
10196 }
10297 }
10398
104- string apiKey = Environment . GetEnvironmentVariable ( ServiceId . ToUpper ( ) + "_APIKEY" ) ;
105- if ( ! string . IsNullOrEmpty ( apiKey ) )
106- ApiKey = apiKey ;
107- string un = Environment . GetEnvironmentVariable ( ServiceId . ToUpper ( ) + "_USERNAME" ) ;
108- if ( ! string . IsNullOrEmpty ( un ) )
109- Username = un ;
110- string pw = Environment . GetEnvironmentVariable ( ServiceId . ToUpper ( ) + "_PASSWORD" ) ;
111- if ( ! string . IsNullOrEmpty ( pw ) )
112- Password = pw ;
99+ string ApiKey = Environment . GetEnvironmentVariable ( ServiceId . ToUpper ( ) + "_APIKEY" ) ;
100+ string Username = Environment . GetEnvironmentVariable ( ServiceId . ToUpper ( ) + "_USERNAME" ) ;
101+ string Password = Environment . GetEnvironmentVariable ( ServiceId . ToUpper ( ) + "_PASSWORD" ) ;
113102 string ServiceUrl = Environment . GetEnvironmentVariable ( ServiceId . ToUpper ( ) + "_URL" ) ;
114103
115104 if ( string . IsNullOrEmpty ( ApiKey ) && ( string . IsNullOrEmpty ( Username ) || string . IsNullOrEmpty ( Password ) ) )
@@ -124,7 +113,7 @@ public Assistant()
124113 IamApiKey = ApiKey
125114 } ;
126115
127- Credentials = new Credentials ( tokenOptions , Endpoint ) ;
116+ Credentials = new Credentials ( tokenOptions , ServiceUrl ) ;
128117
129118 if ( string . IsNullOrEmpty ( Credentials . Url ) )
130119 {
0 commit comments