diff --git a/src/components/layout/MainContent.tsx b/src/components/layout/MainContent.tsx index 1792ca6..396e1e5 100644 --- a/src/components/layout/MainContent.tsx +++ b/src/components/layout/MainContent.tsx @@ -118,6 +118,11 @@ const CUSTOM_PAGES: Record = { () => import('@/features/deletedAccounts/DeletedAccountsPage'), (m) => m.DeletedAccountsPage, ), + // Account › Credentials: the signed-in account's own passkeys (#250) + Passkeys: onDemand( + () => import('@/features/passkeys/OwnPasskeysPage'), + (m) => m.OwnPasskeysPage, + ), Deliverability: onDemand( () => import('@/features/deliverability/DeliverabilityPage'), (m) => m.DeliverabilityPage, diff --git a/src/features/passkeys/OwnPasskeysPage.tsx b/src/features/passkeys/OwnPasskeysPage.tsx new file mode 100644 index 0000000..89a7bf0 --- /dev/null +++ b/src/features/passkeys/OwnPasskeysPage.tsx @@ -0,0 +1,22 @@ +/* + * SPDX-FileCopyrightText: 2026 Coffey Labs LLC + * + * SPDX-License-Identifier: AGPL-3.0-only + */ + +/** + * INBUXA: Account › Credentials › Passkeys (#250). The same card an + * administrator sees on Directory › Accounts, for the signed-in account, so + * anyone who can open the console manages their own passkeys without + * needing access to the account list. + */ + +import { Loader2 } from 'lucide-react'; +import { useAuthStore } from '@/stores/authStore'; +import { PasskeysPanel } from './PasskeysPanel'; + +export function OwnPasskeysPage() { + const accountId = useAuthStore((s) => s.primaryAccountId); + if (!accountId) return ; + return ; +} diff --git a/src/lib/layout.test.ts b/src/lib/layout.test.ts index e28b491..c673069 100644 --- a/src/lib/layout.test.ts +++ b/src/lib/layout.test.ts @@ -67,6 +67,11 @@ describe('layout visibility', () => { expect(visibleLayouts(schema, 'enterprise', ehlo).map((l) => l.name)).toEqual(['Settings']); }); + it('shows your own passkeys to an account that may read passkeys (#250)', () => { + expect(isLinkVisible(schema, 'CustomComponent/Passkeys', 'oss', canGetFrom(['sysPasskeyGet']))).toBe(true); + expect(isLinkVisible(schema, 'CustomComponent/Passkeys', 'oss', canGetFrom([]))).toBe(false); + }); + it('hides a page this console cannot draw', () => { const all = () => true; expect(isLinkVisible(schema, 'CustomComponent/NotInThisConsole', 'enterprise', all)).toBe(false); diff --git a/src/lib/layout.ts b/src/lib/layout.ts index 8c2789f..e4cba50 100644 --- a/src/lib/layout.ts +++ b/src/lib/layout.ts @@ -65,6 +65,8 @@ const PAGES: Record = { 'CustomComponent/SharedMailboxes': readOnly('sysAccountLock'), 'CustomComponent/DeletedAccounts': readOnly('sysAccount'), 'CustomComponent/Deliverability': readOnly('sysDeliverability'), + // Your own passkeys, under Account › Credentials (#250) + 'CustomComponent/Passkeys': readOnly('sysPasskey'), 'CustomComponent/ScheduledReports': readOnly('sysScheduledReport'), // A migration has no read permission of its own: running one is the right 'CustomComponent/Migrations': { enterprise: false, visible: (c) => holds('sysMigrationRun', c) },