From 8d896cbd6e4b2174a2b34e95e8438a3f0e2d3ec8 Mon Sep 17 00:00:00 2001 From: Alma Date: Fri, 11 Apr 2025 12:01:54 +0200 Subject: [PATCH] widget chat 14 --- app/api/auth/[...nextauth]/route.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/api/auth/[...nextauth]/route.ts b/app/api/auth/[...nextauth]/route.ts index fce1bbd5..978ac476 100644 --- a/app/api/auth/[...nextauth]/route.ts +++ b/app/api/auth/[...nextauth]/route.ts @@ -157,6 +157,7 @@ export const authOptions: NextAuthOptions = { if (userInfo.user && userInfo.user._id) { rocketChatUserId = userInfo.user._id; + console.log('Found user ID:', rocketChatUserId); } else { console.error('No user ID found in Rocket.Chat response'); return newToken; @@ -198,7 +199,10 @@ export const authOptions: NextAuthOptions = { } if (personalToken && rocketChatUserId) { - console.log('Setting Rocket.Chat credentials in token'); + console.log('Setting Rocket.Chat credentials in token:', { + token: personalToken, + userId: rocketChatUserId + }); return { ...newToken, rocketChatToken: personalToken,