Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(provider: IProvider) {
if (provider) {
const authenticationHandler = new AuthenticationHandler(provider);
const retryHandler = new RetryHandler(new RetryHandlerOptions());
const telemetryHandler = new TelemetryHandler();
const sdkVersionMiddleware = new SdkVersionMiddleware();
const httpMessageHandler = new HTTPMessageHandler();
authenticationHandler.setNext(retryHandler);
retryHandler.setNext(telemetryHandler);
telemetryHandler.setNext(sdkVersionMiddleware);
sdkVersionMiddleware.setNext(httpMessageHandler);
this.client = Client.initWithMiddleware({
middleware: authenticationHandler
});
}
}