@agenticmail/enterprise 0.5.292 → 0.5.293

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -218,10 +218,9 @@ function App() {
218
218
  items: section.items.filter(item => hasAccess(item.id))
219
219
  })).filter(section => section.items.length > 0);
220
220
 
221
- // Block access to pages user can't see (redirect to first available)
221
+ // Block access to pages user can't see show unauthorized page
222
222
  const canAccessPage = hasAccess(page);
223
- const effectivePage = canAccessPage ? page : (filteredNav[0]?.items[0]?.id || 'dashboard');
224
- const PageComponent = pages[effectivePage] || DashboardPage;
223
+ const PageComponent = canAccessPage ? (pages[page] || DashboardPage) : null;
225
224
  const sidebarClass = 'sidebar' + (sidebarPinned ? ' expanded' : sidebarHovered ? ' hover-expanded' : '') + (mobileMenuOpen ? ' mobile-open' : '');
226
225
 
227
226
  return h(AppContext.Provider, { value: { toast, toasts, user, theme, setPage, permissions } },
@@ -284,7 +283,29 @@ function App() {
284
283
  ? h(AgentDetailPage, { agentId: selectedAgentId, onBack: () => { _setSelectedAgentId(null); _setPage('agents'); history.pushState(null, '', '/dashboard/agents'); } })
285
284
  : page === 'agents'
286
285
  ? h(AgentsPage, { onSelectAgent: navigateToAgent })
287
- : h(PageComponent)
286
+ : PageComponent ? h(PageComponent)
287
+ : h('div', { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', minHeight: '60vh', textAlign: 'center', padding: 40 } },
288
+ h('div', { style: { width: 64, height: 64, borderRadius: '50%', background: 'var(--danger-soft, rgba(220,38,38,0.1))', display: 'flex', alignItems: 'center', justifyContent: 'center', marginBottom: 20 } },
289
+ h('svg', { width: 32, height: 32, viewBox: '0 0 24 24', fill: 'none', stroke: 'var(--danger, #dc2626)', strokeWidth: 2, strokeLinecap: 'round', strokeLinejoin: 'round' },
290
+ h('rect', { x: 3, y: 11, width: 18, height: 11, rx: 2, ry: 2 }),
291
+ h('path', { d: 'M7 11V7a5 5 0 0 1 10 0v4' })
292
+ )
293
+ ),
294
+ h('h2', { style: { fontSize: 20, fontWeight: 700, marginBottom: 8, color: 'var(--text-primary)' } }, 'Access Restricted'),
295
+ h('p', { style: { fontSize: 14, color: 'var(--text-muted)', maxWidth: 400, lineHeight: 1.6, marginBottom: 24 } },
296
+ 'You don\'t have permission to access this page. If you believe this is an error, please contact your company administrator to request access.'
297
+ ),
298
+ h('div', { style: { display: 'flex', gap: 12 } },
299
+ filteredNav[0]?.items[0] && h('button', {
300
+ className: 'btn btn-primary',
301
+ onClick: () => { setPage(filteredNav[0].items[0].id); history.pushState(null, '', '/dashboard/' + filteredNav[0].items[0].id); }
302
+ }, 'Go to ' + filteredNav[0].items[0].label),
303
+ h('button', {
304
+ className: 'btn btn-secondary',
305
+ onClick: () => { window.location.href = 'mailto:?subject=Access%20Request&body=I%20need%20access%20to%20the%20' + encodeURIComponent(page) + '%20page%20in%20the%20dashboard.'; }
306
+ }, 'Request Access')
307
+ )
308
+ )
288
309
  )
289
310
  )
290
311
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticmail/enterprise",
3
- "version": "0.5.292",
3
+ "version": "0.5.293",
4
4
  "description": "AgenticMail Enterprise — cloud-hosted AI agent identity, email, auth & compliance for organizations",
5
5
  "type": "module",
6
6
  "bin": {
@@ -218,10 +218,9 @@ function App() {
218
218
  items: section.items.filter(item => hasAccess(item.id))
219
219
  })).filter(section => section.items.length > 0);
220
220
 
221
- // Block access to pages user can't see (redirect to first available)
221
+ // Block access to pages user can't see show unauthorized page
222
222
  const canAccessPage = hasAccess(page);
223
- const effectivePage = canAccessPage ? page : (filteredNav[0]?.items[0]?.id || 'dashboard');
224
- const PageComponent = pages[effectivePage] || DashboardPage;
223
+ const PageComponent = canAccessPage ? (pages[page] || DashboardPage) : null;
225
224
  const sidebarClass = 'sidebar' + (sidebarPinned ? ' expanded' : sidebarHovered ? ' hover-expanded' : '') + (mobileMenuOpen ? ' mobile-open' : '');
226
225
 
227
226
  return h(AppContext.Provider, { value: { toast, toasts, user, theme, setPage, permissions } },
@@ -284,7 +283,29 @@ function App() {
284
283
  ? h(AgentDetailPage, { agentId: selectedAgentId, onBack: () => { _setSelectedAgentId(null); _setPage('agents'); history.pushState(null, '', '/dashboard/agents'); } })
285
284
  : page === 'agents'
286
285
  ? h(AgentsPage, { onSelectAgent: navigateToAgent })
287
- : h(PageComponent)
286
+ : PageComponent ? h(PageComponent)
287
+ : h('div', { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', minHeight: '60vh', textAlign: 'center', padding: 40 } },
288
+ h('div', { style: { width: 64, height: 64, borderRadius: '50%', background: 'var(--danger-soft, rgba(220,38,38,0.1))', display: 'flex', alignItems: 'center', justifyContent: 'center', marginBottom: 20 } },
289
+ h('svg', { width: 32, height: 32, viewBox: '0 0 24 24', fill: 'none', stroke: 'var(--danger, #dc2626)', strokeWidth: 2, strokeLinecap: 'round', strokeLinejoin: 'round' },
290
+ h('rect', { x: 3, y: 11, width: 18, height: 11, rx: 2, ry: 2 }),
291
+ h('path', { d: 'M7 11V7a5 5 0 0 1 10 0v4' })
292
+ )
293
+ ),
294
+ h('h2', { style: { fontSize: 20, fontWeight: 700, marginBottom: 8, color: 'var(--text-primary)' } }, 'Access Restricted'),
295
+ h('p', { style: { fontSize: 14, color: 'var(--text-muted)', maxWidth: 400, lineHeight: 1.6, marginBottom: 24 } },
296
+ 'You don\'t have permission to access this page. If you believe this is an error, please contact your company administrator to request access.'
297
+ ),
298
+ h('div', { style: { display: 'flex', gap: 12 } },
299
+ filteredNav[0]?.items[0] && h('button', {
300
+ className: 'btn btn-primary',
301
+ onClick: () => { setPage(filteredNav[0].items[0].id); history.pushState(null, '', '/dashboard/' + filteredNav[0].items[0].id); }
302
+ }, 'Go to ' + filteredNav[0].items[0].label),
303
+ h('button', {
304
+ className: 'btn btn-secondary',
305
+ onClick: () => { window.location.href = 'mailto:?subject=Access%20Request&body=I%20need%20access%20to%20the%20' + encodeURIComponent(page) + '%20page%20in%20the%20dashboard.'; }
306
+ }, 'Request Access')
307
+ )
308
+ )
288
309
  )
289
310
  )
290
311
  ),