Skip to content

Commit a70d78a

Browse files
committed
skip parsing and immediately resiarilizing the session. This is helpful
to forward possible errors that didn't come as json
1 parent 249058b commit a70d78a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

server/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ app.get("/sso/metabase", async (req, res) => {
5050

5151
try {
5252
const response = await fetch(ssoUrl, { method: 'GET' })
53-
const token = await response.json()
53+
const session = await response.text()
5454

55-
console.log("Received token", token)
56-
return res.status(200).json(token)
55+
console.log("Received session", session)
56+
return res.status(200).set("Content-Type", "application/json").end(session)
5757
} catch (error) {
5858
if (error instanceof Error) {
5959
res.status(401).json({

0 commit comments

Comments
 (0)