- 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}`,
- });
- }
-