refactor: use db instance instead of service in auth service

This commit is contained in:
Stavros
2025-08-27 11:51:25 +03:00
parent 7050e68c7c
commit 3bc3cb9641
3 changed files with 35 additions and 19 deletions

View File

@@ -92,16 +92,28 @@ func (app *BootstrapApp) Setup() error {
}
}
// Bootstrap database
databaseService := service.NewDatabaseService(service.DatabaseServiceConfig{
DatabasePath: app.Config.DatabasePath,
})
log.Debug().Str("service", fmt.Sprintf("%T", databaseService)).Msg("Initializing service")
err = databaseService.Init()
if err != nil {
return fmt.Errorf("failed to initialize database service: %w", err)
}
database := databaseService.GetDatabase()
// Create services
dockerService := service.NewDockerService()
authService := service.NewAuthService(authConfig, dockerService, ldapService, databaseService)
authService := service.NewAuthService(authConfig, dockerService, ldapService, database)
oauthBrokerService := service.NewOAuthBrokerService(app.getOAuthBrokerConfig())
// Initialize services
services := []Service{
databaseService,
dockerService,
authService,
oauthBrokerService,