forked from baron/baron-sso
가입 전략 수립
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user