Skip to content
This repository has been archived by the owner on Dec 9, 2023. It is now read-only.

Commit

Permalink
update connection routines
Browse files Browse the repository at this point in the history
  • Loading branch information
LukePulverenti committed May 5, 2018
1 parent 1d70206 commit e65c4b2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions connectionmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,20 @@ export default class ConnectionManager {
return apiClient;
};

self.getOrCreateApiClient = serverId => {

const credentials = credentialProvider.credentials();
const servers = credentials.Servers.filter(s => stringEqualsIgnoreCase(s.Id, serverId));

if (!servers.length) {
throw new Error(`Server not found: ${serverId}`);
}

const server = servers[0];

return self._getOrAddApiClient(server, getServerAddress(server, server.LastConnectionMode));
};

function onAuthenticated(apiClient, result, options, saveCredentials) {

const credentials = credentialProvider.credentials();
Expand Down

0 comments on commit e65c4b2

Please sign in to comment.