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,