diff --git a/WorkFlow.API/Extensions/DIExtensions.cs b/WorkFlow.API/Extensions/DIExtensions.cs index 565590d..933c9ac 100644 --- a/WorkFlow.API/Extensions/DIExtensions.cs +++ b/WorkFlow.API/Extensions/DIExtensions.cs @@ -9,6 +9,6 @@ namespace WorkFlow.API.Extensions => services.AddSingleton(provider => new(isValidKey: isValidKey, headerName: headerName)); public static IServiceCollection AddAPIKeyAuth(this IServiceCollection services, APIKeyAuthOptions options) - => services.AddAPIKeyAuth(isValidKey: key => key == options.Key, headerName: options.HeaderName); + => services.AddAPIKeyAuth(isValidKey: key => options.Key is null || options.Key == key, headerName: options.HeaderName); } } \ No newline at end of file