From 4bb4252943e8e9f6f82a3a70f173f4fcb51c1a82 Mon Sep 17 00:00:00 2001 From: Alex Youssefinia Date: Wed, 11 Dec 2024 18:20:48 -0600 Subject: [PATCH] change to custom:user_roles --- services/ui-src/src/Routes.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/ui-src/src/Routes.tsx b/services/ui-src/src/Routes.tsx index f9fe99132..63a357955 100644 --- a/services/ui-src/src/Routes.tsx +++ b/services/ui-src/src/Routes.tsx @@ -156,6 +156,7 @@ const isAdminUser = ()=> { idTokenKey && localStorage.getItem(idTokenKey[0]); if (!idToken) return false; const decodedIdToken: any = jwt_decode(idToken); + let userRoles = decodedIdToken["custom:user_roles"]; const allowedRoles = [ "cmsroleapprover", @@ -165,8 +166,7 @@ const isAdminUser = ()=> { ]; // only passes admin check if roles from jwt one of the "allowed roles" - if (decodedIdToken?.user_roles) { - let userRoles = decodedIdToken.user_roles; + if (userRoles) { try { userRoles = JSON.parse(userRoles); } catch (error) {