diff --git a/plugins/dotnet-auth-core-identity/src/core/create-builders-services.ts b/plugins/dotnet-auth-core-identity/src/core/create-builders-services.ts index 6c41f3b3..1627d10c 100644 --- a/plugins/dotnet-auth-core-identity/src/core/create-builders-services.ts +++ b/plugins/dotnet-auth-core-identity/src/core/create-builders-services.ts @@ -10,12 +10,11 @@ export function createBuildersServices( }) ); - const swaggerBuilder = builderServicesBlocks.find((builder) => - builder.toString().includes("AddSwaggerGen") + const swaggerBuilderIndex = builderServicesBlocks.findIndex((b) => + b.toString().includes("AddSwaggerGen") ); - if (!swaggerBuilder) return; - const swaggerBuilderIndex = builderServicesBlocks.indexOf(swaggerBuilder); + if (swaggerBuilderIndex === -1) return; builderServicesBlocks[swaggerBuilderIndex] = new CodeBlock({ references: [