mirror of
https://github.com/fosrl/pangolin.git
synced 2026-10-15 17:19:05 +02:00
Push client identities to newt
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user