session correction sidebar items 6
This commit is contained in:
parent
136627f226
commit
ea05b15276
@ -95,11 +95,12 @@ export const authOptions: NextAuthOptions = {
|
||||
profile(profile) {
|
||||
console.log('Keycloak profile:', {
|
||||
rawRoles: profile.roles,
|
||||
realmAccess: profile.realm_access,
|
||||
profile
|
||||
});
|
||||
|
||||
// Get roles from the token claims
|
||||
const roles = profile.roles || [];
|
||||
// Get roles from realm_access
|
||||
const roles = profile.realm_access?.roles || [];
|
||||
console.log('Raw roles from Keycloak:', roles);
|
||||
|
||||
// Clean up roles by removing ROLE_ prefix and converting to lowercase
|
||||
@ -131,7 +132,8 @@ export const authOptions: NextAuthOptions = {
|
||||
const keycloakProfile = profile as KeycloakProfile;
|
||||
console.log('JWT callback profile:', {
|
||||
rawRoles: keycloakProfile.roles,
|
||||
profile: keycloakProfile
|
||||
profile: keycloakProfile,
|
||||
token: account.access_token
|
||||
});
|
||||
|
||||
// Clean up roles by removing ROLE_ prefix and converting to lowercase
|
||||
|
||||
Loading…
Reference in New Issue
Block a user