Skip to content

Commit a779889

Browse files
committed
Fixed Worker API auth by rebuilding service after BCrypt hash update
Service required rebuild/restart to load updated appsettings.json containing BCrypt-hashed admin password. Authentication now works properly with secure password storage.
1 parent 2e43b39 commit a779889

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Castellan.Worker/Program.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,10 @@
235235
Console.WriteLine("Validating configuration options...");
236236
try
237237
{
238-
var authOptions = scope.ServiceProvider.GetRequiredService<IOptionsMonitor<AuthenticationOptions>>();
239-
var qdrantOptions = scope.ServiceProvider.GetRequiredService<IOptionsMonitor<QdrantOptions>>();
240-
var pipelineOptions = scope.ServiceProvider.GetRequiredService<IOptionsMonitor<PipelineOptions>>();
238+
using var configScope = builder.Services.BuildServiceProvider().CreateScope();
239+
var authOptions = configScope.ServiceProvider.GetRequiredService<IOptionsMonitor<AuthenticationOptions>>();
240+
var qdrantOptions = configScope.ServiceProvider.GetRequiredService<IOptionsMonitor<QdrantOptions>>();
241+
var pipelineOptions = configScope.ServiceProvider.GetRequiredService<IOptionsMonitor<PipelineOptions>>();
241242

242243
// Accessing .Value will trigger validation
243244
_ = authOptions.CurrentValue;

0 commit comments

Comments
 (0)