widget chat 22
This commit is contained in:
parent
a0b0650a2c
commit
fb36b0334a
@ -83,7 +83,8 @@ export const authOptions: NextAuthOptions = {
|
|||||||
async jwt({ token, account, profile }) {
|
async jwt({ token, account, profile }) {
|
||||||
console.log('JWT callback called with:', { 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
|
// 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}`, {
|
const userInfoResponse = await fetch(`${process.env.ROCKET_CHAT_URL}/api/v1/users.info?username=${token.username}`, {
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user