1
0
forked from baron/baron-sso

fix(user): preserve multi-tenant companyCodes and fix Kratos code parsing

- UpdateUser: Implement 'Preserve & Merge' logic to fetch existing joined
  tenants from Keto and merge them with UI requests, preventing the
  loss of multi-tenant affiliations.
- Keto Sync: Expand the self-healing background job to iterate over all
  companyCodes, ensuring 'members' relations are created for every
  joined tenant (fixes #554).
- AuthHandler: Update extractFirstString to gracefully handle numeric
  JSON types, fixing an issue where Kratos login codes were lost during
  Courier webhook processing.
This commit is contained in:
2026-04-15 16:01:31 +09:00
parent 948dc2236b
commit 726ac71214
2 changed files with 78 additions and 10 deletions

View File

@@ -3767,6 +3767,13 @@ func extractFirstString(data map[string]interface{}, keys ...string) string {
if str, ok := val.(string); ok && str != "" {
return str
}
// Handle numeric types by converting to string
if num, ok := val.(float64); ok {
return fmt.Sprint(num)
}
if num, ok := val.(int); ok {
return fmt.Sprint(num)
}
}
}
return ""