Greetings, all.
Im evaluating a metabase installation in the cloud for one of my clients. I’ve decided to try and use the sample nodejs application built from the git hub repo here:
I have the node app up and running and am trying to use the /signed_chart/:id route.
Here is the code:
app.get("/signed_chart/:id", checkAuth, (req, res) => {
console.log("WE ARE HERE - inside signed_chart: ");
const userId = req.session.userId;
console.log("userid: " + userId);
const unsignedToken = {
resource: { question: 3 },
//original line: params: { person_id: userId },
//params: { id: userId },sign
params: { person_id: userId },
exp: Math.round(Date.now() / 1000) + (10 * 60) // 10 minute expiration
};
// sign the JWT token with our secret key
const signedToken = jwt.sign(unsignedToken, MB_EMBEDDING_SECRET_KEY);
// construct the URL of the iframe to be displayed
console.log("signed token: " + signedToken);
const iframeUrl = `${MB_SITE_URL}/embed/question/${signedToken}`;
res.render("chart", { userId: req.params.id, iframeUrl: iframeUrl });
})
node will then render the chart pug and give me 3 useful pieces of information:
-
The jwt payload that’s being sent to metabase
-
The iframe code where it will render the chart into the html portion of our application
-
An actual iframe that should be displaying the chart embedded into the application
I get an error here, too:
Unknown parameter :person_id.
The console debugger has a lot of errors, as well, but lets just start with this and see if we can figure it out without wasting bits dumping error logs.
Thanks for your help,
Chris