session correction sidebar items 4
This commit is contained in:
parent
932ee9f94c
commit
1440eae3a2
@ -93,8 +93,12 @@ export const authOptions: NextAuthOptions = {
|
||||
profile
|
||||
});
|
||||
|
||||
// Get roles from the token claims
|
||||
const roles = profile.roles || [];
|
||||
console.log('Raw roles from Keycloak:', roles);
|
||||
|
||||
// Clean up roles by removing ROLE_ prefix and converting to lowercase
|
||||
const cleanRoles = (profile.roles ?? []).map(role =>
|
||||
const cleanRoles = roles.map(role =>
|
||||
role.replace(/^ROLE_/, '').toLowerCase()
|
||||
);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user