From 8c6c93c7240280f663c1315b83de685cf050cb1e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicol=C3=B2=20Pretto?= <info@npretto.com>
Date: Tue, 12 Nov 2024 11:36:43 +0100
Subject: [PATCH] skip json() -> JSON.stringify and just forward the text
 (#49792)

---
 docs/embedding/sdk/authentication.md | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/docs/embedding/sdk/authentication.md b/docs/embedding/sdk/authentication.md
index 699c01ac6b1..f901fb4cd6b 100644
--- a/docs/embedding/sdk/authentication.md
+++ b/docs/embedding/sdk/authentication.md
@@ -52,9 +52,10 @@ async function metabaseAuthHandler(req, res) {
 
   try {
     const response = await fetch(ssoUrl, { method: "GET" });
-    const token = await response.json();
+    const session = await response.text();
 
-    return res.status(200).json(token);
+    console.log("Received session", session);
+    return res.status(200).set("Content-Type", "application/json").end(session);
   } catch (error) {
     if (error instanceof Error) {
       res.status(401).json({
-- 
GitLab