Push client identities to newt

This commit is contained in:
Owen
2026-10-12 17:03:27 -04:00
parent b43709903d
commit c6b1e5311e
8 changed files with 474 additions and 10 deletions
+11
View File
@@ -12,6 +12,7 @@ import { fromError } from "zod-validation-error";
import { isLicensedOrSubscribed } from "#dynamic/lib/isLicencedOrSubscribed";
import { OpenAPITags, registry } from "@server/openApi";
import { tierMatrix } from "@server/lib/billing/tierMatrix";
import { pushClientIdentitiesForRole } from "@server/lib/clientIdentities";
const updateRoleParamsSchema = z.strictObject({
roleId: z.coerce.number().int().positive()
@@ -216,6 +217,16 @@ export async function updateRole(
);
}
if (updateData.name !== undefined && updateData.name !== role[0].name) {
// Role names are forwarded by newt as the Remote-Role header.
pushClientIdentitiesForRole(roleId, orgId).catch((err) => {
logger.error(
`Error pushing client identities after renaming role ${roleId}`,
err
);
});
}
return response(res, {
data: updatedRole,
success: true,