1
0
forked from baron/baron-sso

kratos SSOT 재설계

This commit is contained in:
2026-06-12 18:36:18 +09:00
parent b96c8100e0
commit 8e9d015443
39 changed files with 3960 additions and 501 deletions

View File

@@ -213,5 +213,19 @@ func worksmobileGuardError(c *fiber.Ctx, err error, operation string, attrs ...a
if strings.Contains(err.Error(), "hanmac-family root") {
return errorJSON(c, fiber.StatusNotFound, err.Error())
}
if worksmobileBadRequestError(err) {
return errorJSON(c, fiber.StatusBadRequest, err.Error())
}
return errorJSON(c, fiber.StatusInternalServerError, err.Error())
}
func worksmobileBadRequestError(err error) bool {
message := err.Error()
return strings.Contains(message, "target user tenant is excluded from Worksmobile sync") ||
strings.Contains(message, "target user is outside hanmac-family subtree") ||
strings.Contains(message, "target user has no tenant") ||
strings.Contains(message, "target user status is excluded from Worksmobile sync") ||
strings.Contains(message, "target tenant is excluded from Worksmobile sync") ||
strings.Contains(message, "target tenant is not a worksmobile orgunit tenant") ||
strings.Contains(message, "target orgunit is outside hanmac-family subtree")
}