From 2eff87ad793a2dec4121dfe0fbe7ea9151a7feff Mon Sep 17 00:00:00 2001 From: alma Date: Sat, 3 May 2025 13:11:15 +0200 Subject: [PATCH] cleaning hard 2 --- app/api/auth/[...nextauth]/route.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/api/auth/[...nextauth]/route.ts b/app/api/auth/[...nextauth]/route.ts index 23d7e02a..47848796 100644 --- a/app/api/auth/[...nextauth]/route.ts +++ b/app/api/auth/[...nextauth]/route.ts @@ -176,6 +176,8 @@ export const authOptions: NextAuthOptions = { // Always ensure user has basic user role const finalRoles = [...new Set([...cleanedRoles, 'user'])]; + console.log("Before mapping, finalRoles:", finalRoles); + // Map Keycloak roles to application roles token.role = mapToApplicationRoles(finalRoles); console.log("Mapped application roles:", token.role);