File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -26,13 +26,9 @@ export class Authenticator {
2626 private rwlock = new ReadWriteLock ( ) ;
2727
2828 constructor ( context : Context , options : ConnectionOptions ) {
29+ context . httpClient . authenticator = this ;
2930 this . context = context ;
3031 this . options = options ;
31- if ( context . httpClient . authenticator ) {
32- return context . httpClient . authenticator ;
33- } else {
34- context . httpClient . authenticator = this ;
35- }
3632 }
3733
3834 private getCacheKey ( ) : TokenKey | undefined {
Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ export class FireboltCore {
1616
1717 async connect ( connectionOptions : ConnectionOptions ) {
1818 // Create a new httpClient instance for each connection
19- const httpClient = new NodeHttpClient ( ) ;
19+ const httpClient =
20+ this . options . dependencies ?. httpClient || new NodeHttpClient ( ) ;
2021
2122 // Create a new context with the new httpClient
2223 const connectionContext = {
@@ -38,7 +39,8 @@ export class FireboltCore {
3839
3940 async testConnection ( connectionOptions : ConnectionOptions ) {
4041 // Create a new httpClient instance for test connection too
41- const httpClient = new NodeHttpClient ( ) ;
42+ const httpClient =
43+ this . options . dependencies ?. httpClient || new NodeHttpClient ( ) ;
4244
4345 // Create a new context with the new httpClient
4446 const connectionContext = {
You can’t perform that action at this time.
0 commit comments