feat: filter out internal roles (3 for now)
This commit is contained in:
parent
27e545adcd
commit
8ab2ab156f
1 changed files with 5 additions and 1 deletions
|
|
@ -33,7 +33,11 @@ export class KeycloakController extends Controller {
|
|||
@Get("role")
|
||||
async getRole() {
|
||||
const role = await getRoles();
|
||||
if (Array.isArray(role)) return role;
|
||||
if (Array.isArray(role))
|
||||
return role.filter(
|
||||
(a) =>
|
||||
!["uma_authorization", "offline_access", "default-roles"].some((b) => a.name.includes(b)),
|
||||
);
|
||||
throw new Error("Failed. Cannot get role.");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue