diff --git a/app/api/auth/[...nextauth]/route.ts b/app/api/auth/[...nextauth]/route.ts index 39c7c5ef..cbb2f693 100644 --- a/app/api/auth/[...nextauth]/route.ts +++ b/app/api/auth/[...nextauth]/route.ts @@ -107,7 +107,7 @@ export const authOptions: NextAuthOptions = { console.log('Raw roles from Keycloak:', roles); // Clean up roles by removing ROLE_ prefix and converting to lowercase - const cleanRoles = roles.map(role => + const cleanRoles = roles.map((role: string) => role.replace(/^ROLE_/, '').toLowerCase() );