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")
|
@Get("role")
|
||||||
async getRole() {
|
async getRole() {
|
||||||
const role = await getRoles();
|
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.");
|
throw new Error("Failed. Cannot get role.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue