remove hard-coded navLinks entirely, let other modules populate them
[squeep-html-template-helper] / lib / template-helper.js
index e48cdb4fc5e59e17e5179b35a0339f357ba657be..7f7021ae010f2a58be394f17e23ea4120a4570d7 100644 (file)
@@ -358,12 +358,9 @@ ${UL(ctx.notifications, 1)}
 
 
 /**
- * Render all parts of an HTML page. Adds user logout nav link automatically.
+ * Render all parts of an HTML page.
  * @param {Number} pagePathLevel - relative path-distance to base
  * @param {Object} ctx
- * @param {Object=} ctx.session
- * @param {String=} ctx.session.authenticatedIdentifier
- * @param {String=} ctx.session.authenticatedProfile
  * @param {String[]=} ctx.errors
  * @param {String[]=} ctx.notifications
  * @param {Object} options
@@ -382,22 +379,6 @@ ${UL(ctx.notifications, 1)}
  * @returns {String}
  */
 function htmlPage(pagePathLevel, ctx, options, main = []) {
-  const user = ctx?.session?.authenticatedProfile || ctx?.session?.authenticatedIdentifier;
-  if (user) {
-    if (!options.navLinks) {
-      options.navLinks = [];
-    }
-    const logoutRedirect = ctx?.url ? `?r=${encodeURIComponent(ctx.url)}` : '';
-    const adminPath = (pagePathLevel > 0) ? `${'../'.repeat(pagePathLevel - 1)}` : 'admin/';
-    options.navLinks.push({
-      text: 'Account',
-      href: `${adminPath}settings`,
-    }, {
-      text: `Logout (${user})`,
-      href: `${adminPath}logout${logoutRedirect}`,
-    });
-  }
-
   return [
     '<!DOCTYPE html>',
     '<html lang="en">',