widget chat 22

This commit is contained in:
Alma 2025-04-11 12:39:16 +02:00
parent a0b0650a2c
commit fb36b0334a

View File

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