import { useState } from 'react'; import { useQuery } from '@tanstack/react-query'; import { authBootstrapAvailable, authRuntimeConfig } from '../../api/client'; import { useAuthMe } from '../../hooks/useAuthMe'; import PageHeader from '../../components/PageHeader'; import { STALE_TIME } from '../../api/queryConstants'; import { getTimestampPref, setTimestampPref, type TimestampMode } from '../../api/timestampPref'; // ============================================================================= // Bundle 1 Phase 10 — AuthSettingsPage (stub). // // Surfaces: // // - The current actor's identity, roles, effective permissions // (from /v1/auth/me — already cached by useAuthMe). // - Bootstrap-endpoint availability so a fresh-deploy operator // knows whether they can mint the first admin via curl. Shows // "available" pre-admin, "closed" after the first admin lands. // // Bundle 2 will extend this page with OIDC provider config + session // management. Bundle 1 ships only the stub so the route exists and // the navigation entry is wired. // ============================================================================= export default function AuthSettingsPage() { const me = useAuthMe(); const bootstrapQuery = useQuery({ queryKey: ['auth', 'bootstrap', 'available'], queryFn: authBootstrapAvailable, staleTime: STALE_TIME.REFERENCE, // slow-changing auth-runtime data retry: 0, }); // Audit 2026-05-10 MED-12 — Auth runtime config panel. Gated // auth.role.assign server-side; query failure (403) is silently // swallowed (panel hidden) for non-admin viewers. const runtimeQuery = useQuery({ queryKey: ['auth', 'runtime-config'], queryFn: authRuntimeConfig, staleTime: STALE_TIME.REFERENCE, // slow-changing auth-runtime data retry: 0, }); return (
curl -X POST $URL/api/v1/auth/bootstrap -d '{'{'}"token":"…","actor_name":"first-admin"{'}'}' to mint the first admin key.
| Setting | Value |
|---|---|
| {k} | {v || (empty)} |
America/New_York).