openvibers/openvibe.bot Commits
Fix silent sign-in on first visits (Bot) (#337)
Changes
@@@ -277,6 +277,7 @@ function framePage({ config, title, description, canonicalPath = '/', body, headhistory: { type: 'page', title },sessionUrl: '/auth/me',loginUrl: '/auth/login?next={path}',++ silentLogin: '/auth/login?silent=1&next={url}',logoutUrl: '/auth/logout?next={path}',notificationsRealtime: true,};@@@ -338,6 +339,7 @@ function renderHome({ config, signedIn = false, models = [], robots = [], kit =history: { type: 'page', title: SITE_NAME },sessionUrl: '/auth/me',loginUrl: '/auth/login?next={path}',++ silentLogin: '/auth/login?silent=1&next={url}',logoutUrl: '/auth/logout?next={path}',notificationsRealtime: true,};@@@ -21,6 +21,7 @@ const { boot, check, done } = require('./helpers/app');assert.match(csp, /connect-src 'self' https:\/\/openvibe\.network https:\/\/openvibe\.events/);assert.match(csp, /frame-ancestors 'none'/);const html = await r.text();++ assert.ok(html.includes('"silentLogin":"/auth/login?silent=1&next={url}"'), 'first visits use the existing SDK OAuth route');assert.match(html, /<h1>Drive your robot<span class="sc-accent"> from any browser\.<\/span><\/h1>/);assert.match(html, /<meta name="robots" content="index, follow">/);assert.match(html, /<link rel="canonical" href="http:\/\/bot\.test\/">/);
@@ -277,6 +277,7 @@ function framePage({ config, title, description, canonicalPath = '/', body, head
@@ -277,6 +277,7 @@ function framePage({ config, title, description, canonicalPath = '/', body, head
history: { type: 'page', title },
history: { type: 'page', title },
sessionUrl: '/auth/me',
sessionUrl: '/auth/me',
loginUrl: '/auth/login?next={path}',
loginUrl: '/auth/login?next={path}',
+ silentLogin: '/auth/login?silent=1&next={url}',
logoutUrl: '/auth/logout?next={path}',
logoutUrl: '/auth/logout?next={path}',
notificationsRealtime: true,
notificationsRealtime: true,
};
};
@@ -338,6 +339,7 @@ function renderHome({ config, signedIn = false, models = [], robots = [], kit =
@@ -338,6 +339,7 @@ function renderHome({ config, signedIn = false, models = [], robots = [], kit =
history: { type: 'page', title: SITE_NAME },
history: { type: 'page', title: SITE_NAME },
sessionUrl: '/auth/me',
sessionUrl: '/auth/me',
loginUrl: '/auth/login?next={path}',
loginUrl: '/auth/login?next={path}',
+ silentLogin: '/auth/login?silent=1&next={url}',
logoutUrl: '/auth/logout?next={path}',
logoutUrl: '/auth/logout?next={path}',
notificationsRealtime: true,
notificationsRealtime: true,
};
};
@@ -21,6 +21,7 @@ const { boot, check, done } = require('./helpers/app');
@@ -21,6 +21,7 @@ const { boot, check, done } = require('./helpers/app');
assert.match(csp, /connect-src 'self' https:\/\/openvibe\.network https:\/\/openvibe\.events/);
assert.match(csp, /connect-src 'self' https:\/\/openvibe\.network https:\/\/openvibe\.events/);
assert.match(csp, /frame-ancestors 'none'/);
assert.match(csp, /frame-ancestors 'none'/);
const html = await r.text();
const html = await r.text();
+ assert.ok(html.includes('"silentLogin":"/auth/login?silent=1&next={url}"'), 'first visits use the existing SDK OAuth route');
assert.match(html, /<h1>Drive your robot<span class="sc-accent"> from any browser\.<\/span><\/h1>/);
assert.match(html, /<h1>Drive your robot<span class="sc-accent"> from any browser\.<\/span><\/h1>/);
assert.match(html, /<meta name="robots" content="index, follow">/);
assert.match(html, /<meta name="robots" content="index, follow">/);
assert.match(html, /<link rel="canonical" href="http:\/\/bot\.test\/">/);
assert.match(html, /<link rel="canonical" href="http:\/\/bot\.test\/">/);