1
0
forked from baron/baron-sso

가입 전략 수립

This commit is contained in:
2026-02-19 15:10:36 +09:00
parent e6bfcf465f
commit 5cb713a009
7 changed files with 95 additions and 35 deletions

View File

@@ -30,7 +30,8 @@ var defaultTenants = []InitialTenantConfig{
func SeedTenants(db *gorm.DB) error {
slog.Info("[Bootstrap] Seeding initial tenants...")
repo := repository.NewTenantRepository(db)
svc := service.NewTenantService(repo)
userRepo := repository.NewUserRepository(db)
svc := service.NewTenantService(repo, userRepo)
ctx := context.Background()
for _, config := range defaultTenants {
@@ -48,7 +49,7 @@ func SeedTenants(db *gorm.DB) error {
}
if !found {
slog.Info("[Bootstrap] Adding missing domain to tenant", "slug", config.Slug, "domain", d)
if err := repo.AddDomain(ctx, existing.ID, d); err != nil {
if err := repo.AddDomain(ctx, existing.ID, d, true); err != nil {
slog.Error("Failed to add domain", "error", err)
}
}