Skip to content

Commit 335ba55

Browse files
Make embedding SSO work
1 parent fe844c4 commit 335ba55

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,13 @@ app.get('/', function(req, res){
114114
});
115115

116116
app.get('/analytics', restrict, function(req, res){
117-
// this is causing issues for some reason - only works if signing to the instance via SSO first, then going through the flow in the app
118-
// if you start from the app w/o signing to the instance first, it's stuck in some kind of loop
119-
var iframeUrl = "https://metabase-23.hosted.staging.metabase.com/dashboard/2-a-look-at-your-invoices-table"
117+
var iframeUrl = url.format({
118+
pathname: `${METABASE_SITE_URL}/auth/sso`,
119+
query: {
120+
jwt: signUserToken(req.session.user),
121+
return_to: "/dashboard/2-a-look-at-your-invoices-table"
122+
}
123+
})
120124
res.send(`<iframe src="${iframeUrl}" frameborder="0" width="1280" height="600" allowtransparency></iframe>`);
121125
});
122126

0 commit comments

Comments
 (0)