Skip to content

Commit fe844c4

Browse files
Implemented interactive embedding with iframe.
There are some issues with SSO I am still troubleshooting.
1 parent f84db50 commit fe844c4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

index.js

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

116116
app.get('/analytics', restrict, function(req, res){
117-
res.send('Restricted area, click to <a href="/logout">logout</a>');
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"
120+
res.send(`<iframe src="${iframeUrl}" frameborder="0" width="1280" height="600" allowtransparency></iframe>`);
118121
});
119122

120123
app.get('/logout', function(req, res){
@@ -143,8 +146,8 @@ app.post('/login', function (req, res, next) {
143146
req.session.user = user;
144147
req.session.success = 'Authenticated as ' + user.firstName + '' + user.lastName
145148
+ ' click to <a href="/logout">logout</a>. '
146-
+ ' Redirecting to ' + returnTo + '.';
147-
res.redirect(returnTo || '/analytics');
149+
+ ' click to access <a href="/analytics">analytics</a>';
150+
res.redirect(returnTo || '/');
148151
delete req.session.returnTo;
149152
});
150153
} else {

0 commit comments

Comments
 (0)