diff --git a/src/Dapr.Workflow/WorkflowServiceCollectionExtensions.cs b/src/Dapr.Workflow/WorkflowServiceCollectionExtensions.cs index 3c6ce63e0..50880ab24 100644 --- a/src/Dapr.Workflow/WorkflowServiceCollectionExtensions.cs +++ b/src/Dapr.Workflow/WorkflowServiceCollectionExtensions.cs @@ -27,7 +27,6 @@ namespace Dapr.Workflow /// public static class WorkflowServiceCollectionExtensions { - private static string daprApiToken = ""; /// /// Adds Dapr Workflow support to the service collection. @@ -62,10 +61,10 @@ public static IServiceCollection AddDaprWorkflow( if (TryGetGrpcAddress(out string address)) { - daprApiToken = DaprDefaults.GetDefaultDaprApiToken(); + var daprApiToken = DaprDefaults.GetDefaultDaprApiToken(); if (!string.IsNullOrEmpty(daprApiToken)) { - HttpClient client = new HttpClient(); + var client = new HttpClient(); client.DefaultRequestHeaders.Add("Dapr-Api-Token", daprApiToken); builder.UseGrpc(CreateChannel(address, client)); } @@ -101,10 +100,10 @@ public static IServiceCollection AddDaprWorkflowClient(this IServiceCollection s { if (TryGetGrpcAddress(out string address)) { - daprApiToken = DaprDefaults.GetDefaultDaprApiToken(); + var daprApiToken = DaprDefaults.GetDefaultDaprApiToken(); if (!string.IsNullOrEmpty(daprApiToken)) { - HttpClient client = new HttpClient(); + var client = new HttpClient(); client.DefaultRequestHeaders.Add("Dapr-Api-Token", daprApiToken); builder.UseGrpc(CreateChannel(address, client)); }