From fb36b0334a4ac8c84671eafb2caf99cbee2f7444 Mon Sep 17 00:00:00 2001 From: Alma Date: Fri, 11 Apr 2025 12:39:16 +0200 Subject: [PATCH] widget chat 22 --- app/api/auth/[...nextauth]/route.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/api/auth/[...nextauth]/route.ts b/app/api/auth/[...nextauth]/route.ts index d59b5aa2..d6a13b4e 100644 --- a/app/api/auth/[...nextauth]/route.ts +++ b/app/api/auth/[...nextauth]/route.ts @@ -83,7 +83,8 @@ export const authOptions: NextAuthOptions = { async jwt({ token, account, profile }) { console.log('JWT callback called with:', { token, account, profile }); - if (account && profile) { + // Initial sign in + if (account) { // Get user info from Rocket.Chat using the admin token const userInfoResponse = await fetch(`${process.env.ROCKET_CHAT_URL}/api/v1/users.info?username=${token.username}`, { headers: {