refactor: filter out system role

This commit is contained in:
Methapon2001 2024-08-13 20:25:32 +07:00
parent ab08492304
commit 4be62e6bd2

View file

@ -42,7 +42,9 @@ export class KeycloakController extends Controller {
if (Array.isArray(role))
return role.filter(
(a) =>
!["uma_authorization", "offline_access", "default-roles"].some((b) => a.name.includes(b)),
!["uma_authorization", "offline_access", "default-roles", "system"].some((b) =>
a.name.includes(b),
),
);
throw new Error("Failed. Cannot get role.");
}