forked from baron/baron-sso
kratos SSOT 재설계
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user