Skip to content

Instantly share code, notes, and snippets.

View dcbarans's full-sized avatar
🚀

Dominic Baranski dcbarans

🚀
  • 04:21 (UTC -04:00)
View GitHub Profile
@dcbarans
dcbarans / zitadel-roles-fix.diff
Created February 14, 2026 15:25
Zitadel roles fix - handle both array and object formats
diff --git a/apps/backoffice/src/zitadel.ts b/apps/backoffice/src/zitadel.ts
index 8a6ef4fc7..172adaec0 100644
--- a/apps/backoffice/src/zitadel.ts
+++ b/apps/backoffice/src/zitadel.ts
@@ -33,9 +33,14 @@ export async function getUserProfile(): Promise<UserProfile | undefined> {
export async function getUserRoles(profile?: UserProfile): Promise<Role[]> {
const userProfile = profile || (await getUserProfile());
- return Object.keys(
- userProfile?.["urn:zitadel:iam:org:project:roles"] ?? {},