From b9a6589e145256a808bbb9c4060c0418ac2114b1 Mon Sep 17 00:00:00 2001 From: Alma Date: Fri, 11 Apr 2025 12:46:43 +0200 Subject: [PATCH] widget chat 25 --- app/api/auth/[...nextauth]/route.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/api/auth/[...nextauth]/route.ts b/app/api/auth/[...nextauth]/route.ts index d4329461..829d8276 100644 --- a/app/api/auth/[...nextauth]/route.ts +++ b/app/api/auth/[...nextauth]/route.ts @@ -86,9 +86,9 @@ export const authOptions: NextAuthOptions = { // Initial sign in if (account && profile) { // Set user data from profile - token.username = profile.preferred_username; - token.first_name = profile.given_name; - token.last_name = profile.family_name; + token.username = profile.preferred_username || ''; + token.first_name = profile.given_name || ''; + token.last_name = profile.family_name || ''; token.role = profile.groups || []; // Get user info from Rocket.Chat using the admin token