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: {