diff --git a/app/api/rocket-chat/messages/route.ts b/app/api/rocket-chat/messages/route.ts index 60a5dd44..c26cd89c 100644 --- a/app/api/rocket-chat/messages/route.ts +++ b/app/api/rocket-chat/messages/route.ts @@ -9,16 +9,11 @@ export async function GET() { return NextResponse.json({ error: "Unauthorized" }, { status: 401 }); } - // Get the access token from the session - const accessToken = session.accessToken; - if (!accessToken) { - return NextResponse.json({ error: "No access token found" }, { status: 401 }); - } - - // Use the Keycloak token to authenticate with Rocket.Chat + // Use the personal access token to authenticate with Rocket.Chat const response = await fetch('https://parole.slm-lab.net/api/v1/channels.messages', { headers: { - 'Authorization': `Bearer ${accessToken}`, + 'X-Auth-Token': 'C_3ekrsgtsaU0sVQzpJ8aRSyMQjBIvcsmXVvBI8Wmgb', + 'X-User-Id': 'Tpuww59PJKsrGNQJB', }, // Add cache control to prevent stale data cache: 'no-store',