2026-07-04 21:26:22 -05:00
|
|
|
import { useState, useEffect, useCallback } from 'react';
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
import { toast } from 'sonner';
|
|
|
|
|
import { api } from '@/api';
|
2026-07-04 21:26:22 -05:00
|
|
|
import { errMessage } from '@/lib/utils';
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
import { Button } from '@/components/ui/button';
|
|
|
|
|
import { Input } from '@/components/ui/input';
|
|
|
|
|
import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/card';
|
|
|
|
|
import { FieldRow, Toggle } from './adminShared';
|
|
|
|
|
|
2026-07-10 19:10:42 -05:00
|
|
|
const OIDC_ICON_URL = '/img/auth.svg';
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
|
2026-07-04 21:26:22 -05:00
|
|
|
interface OidcForm {
|
|
|
|
|
local_login_enabled: boolean;
|
|
|
|
|
oidc_login_enabled: boolean;
|
|
|
|
|
oidc_provider_name: string;
|
|
|
|
|
oidc_issuer_url: string;
|
|
|
|
|
oidc_client_id: string;
|
|
|
|
|
oidc_client_secret: string;
|
|
|
|
|
oidc_client_secret_clear: boolean;
|
|
|
|
|
oidc_token_auth_method: string;
|
|
|
|
|
oidc_redirect_uri: string;
|
|
|
|
|
oidc_scopes: string;
|
|
|
|
|
oidc_auto_provision: boolean;
|
|
|
|
|
oidc_admin_group: string;
|
|
|
|
|
oidc_default_role: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface AuthConfigData {
|
|
|
|
|
local_login_enabled?: boolean;
|
|
|
|
|
oidc_login_enabled?: boolean;
|
|
|
|
|
oidc_provider_name?: string;
|
|
|
|
|
oidc_issuer_url?: string;
|
|
|
|
|
oidc_client_id?: string;
|
|
|
|
|
oidc_token_auth_method?: string;
|
|
|
|
|
oidc_redirect_uri?: string;
|
|
|
|
|
oidc_scopes?: string;
|
|
|
|
|
oidc_auto_provision?: boolean;
|
|
|
|
|
oidc_admin_group?: string;
|
|
|
|
|
oidc_default_role?: string;
|
|
|
|
|
oidc_client_secret_set?: boolean;
|
|
|
|
|
oidc_configured?: boolean;
|
|
|
|
|
oidc_env_fallback_used?: boolean;
|
|
|
|
|
warnings?: string[];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface OidcTestResult {
|
|
|
|
|
ok?: boolean;
|
|
|
|
|
error?: string;
|
|
|
|
|
issuer?: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function defaultOidcRedirectUri(): string {
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
if (typeof window === 'undefined') return '';
|
|
|
|
|
return `${window.location.origin}/api/auth/oidc/callback`;
|
|
|
|
|
}
|
|
|
|
|
|
2026-07-04 21:26:22 -05:00
|
|
|
function looksLikeOidcEndpoint(url: string | null | undefined): boolean {
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
const value = String(url || '').toLowerCase();
|
|
|
|
|
return /\/(?:authorize|token|userinfo|jwks|certs)\/?$/.test(value);
|
|
|
|
|
}
|
|
|
|
|
|
2026-07-04 21:26:22 -05:00
|
|
|
function formFromData(d: AuthConfigData): OidcForm {
|
|
|
|
|
return {
|
|
|
|
|
local_login_enabled: d.local_login_enabled !== false,
|
2026-07-06 14:23:53 -05:00
|
|
|
oidc_login_enabled: !!d.oidc_login_enabled,
|
|
|
|
|
oidc_provider_name: d.oidc_provider_name || 'authentik',
|
|
|
|
|
oidc_issuer_url: d.oidc_issuer_url || '',
|
|
|
|
|
oidc_client_id: d.oidc_client_id || '',
|
|
|
|
|
oidc_client_secret: '',
|
2026-07-04 21:26:22 -05:00
|
|
|
oidc_client_secret_clear: false,
|
|
|
|
|
oidc_token_auth_method: d.oidc_token_auth_method || 'client_secret_basic',
|
2026-07-06 14:23:53 -05:00
|
|
|
oidc_redirect_uri: d.oidc_redirect_uri || defaultOidcRedirectUri(),
|
|
|
|
|
oidc_scopes: d.oidc_scopes || 'openid email profile groups',
|
2026-07-04 21:26:22 -05:00
|
|
|
oidc_auto_provision: d.oidc_auto_provision !== false,
|
2026-07-06 14:23:53 -05:00
|
|
|
oidc_admin_group: d.oidc_admin_group || '',
|
|
|
|
|
oidc_default_role: d.oidc_default_role || 'user',
|
2026-07-04 21:26:22 -05:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
export default function AuthMethodsCard() {
|
2026-07-06 14:23:53 -05:00
|
|
|
const [data, setData] = useState<AuthConfigData | null>(null);
|
|
|
|
|
const [form, setForm] = useState<OidcForm | null>(null);
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
const [loading, setLoading] = useState(true);
|
2026-07-06 14:23:53 -05:00
|
|
|
const [saving, setSaving] = useState(false);
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
const [testingOidc, setTestingOidc] = useState(false);
|
2026-07-06 14:23:53 -05:00
|
|
|
const [oidcTest, setOidcTest] = useState<OidcTestResult | null>(null);
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
|
|
|
|
|
const load = useCallback(async () => {
|
|
|
|
|
try {
|
2026-07-06 14:23:53 -05:00
|
|
|
const d = (await api.authModeConfig()) as AuthConfigData;
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
setData(d);
|
2026-07-04 21:26:22 -05:00
|
|
|
setForm(formFromData(d));
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
} catch (err) {
|
2026-07-04 21:26:22 -05:00
|
|
|
toast.error(errMessage(err, 'Failed to load auth settings.'));
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
} finally {
|
|
|
|
|
setLoading(false);
|
|
|
|
|
}
|
|
|
|
|
}, []);
|
|
|
|
|
|
2026-07-06 14:23:53 -05:00
|
|
|
useEffect(() => {
|
|
|
|
|
load();
|
|
|
|
|
}, [load]);
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
|
2026-07-06 14:23:53 -05:00
|
|
|
const set = (k: keyof OidcForm, v: string | boolean) =>
|
|
|
|
|
setForm((prev) => (prev ? ({ ...prev, [k]: v } as OidcForm) : prev));
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
|
|
|
|
|
async function handleSave() {
|
|
|
|
|
setSaving(true);
|
|
|
|
|
try {
|
2026-07-06 14:23:53 -05:00
|
|
|
const d = (await api.setAuthMode(form)) as AuthConfigData;
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
setData(d);
|
2026-07-04 21:26:22 -05:00
|
|
|
setForm(formFromData(d));
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
toast.success('Auth method settings saved.');
|
|
|
|
|
} catch (err) {
|
2026-07-04 21:26:22 -05:00
|
|
|
toast.error(errMessage(err, 'Failed to save auth method settings.'));
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
} finally {
|
|
|
|
|
setSaving(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function handleTestOidc() {
|
|
|
|
|
setTestingOidc(true);
|
|
|
|
|
setOidcTest(null);
|
|
|
|
|
try {
|
2026-07-06 14:23:53 -05:00
|
|
|
const result = (await api.testOidcConfig(form)) as OidcTestResult;
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
setOidcTest(result);
|
|
|
|
|
toast.success('authentik configuration test passed.');
|
|
|
|
|
} catch (err) {
|
2026-07-04 21:26:22 -05:00
|
|
|
const e = err as { data?: OidcTestResult; message?: string };
|
|
|
|
|
const result = e.data || { ok: false, error: e.message || 'OIDC configuration test failed.' };
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
setOidcTest(result);
|
|
|
|
|
toast.error(result.error || 'OIDC configuration test failed.');
|
|
|
|
|
} finally {
|
|
|
|
|
setTestingOidc(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (loading || !form) {
|
|
|
|
|
return (
|
|
|
|
|
<Card>
|
|
|
|
|
<CardContent className="py-8 text-center text-muted-foreground text-sm">
|
|
|
|
|
Loading auth settings…
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const secretAvailable = form.oidc_client_secret.trim()
|
|
|
|
|
? true
|
|
|
|
|
: form.oidc_client_secret_clear
|
2026-07-06 14:23:53 -05:00
|
|
|
? false
|
|
|
|
|
: !!data?.oidc_client_secret_set;
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
const oidcConfigured = !!(
|
|
|
|
|
form.oidc_issuer_url.trim() &&
|
|
|
|
|
form.oidc_client_id.trim() &&
|
|
|
|
|
secretAvailable &&
|
|
|
|
|
form.oidc_redirect_uri.trim()
|
|
|
|
|
);
|
2026-07-06 14:23:53 -05:00
|
|
|
const adminGroupConfigured = !!form.oidc_admin_group.trim();
|
|
|
|
|
const wouldLockOut = !form.local_login_enabled && !form.oidc_login_enabled;
|
|
|
|
|
const cantDisableLocal =
|
|
|
|
|
!form.local_login_enabled &&
|
|
|
|
|
(!oidcConfigured || !form.oidc_login_enabled || !adminGroupConfigured);
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
const oidcEnabledButIncomplete = form.oidc_login_enabled && !oidcConfigured;
|
2026-07-06 14:23:53 -05:00
|
|
|
const canSave = !wouldLockOut && !cantDisableLocal && !oidcEnabledButIncomplete && !saving;
|
|
|
|
|
const canTestOidc = oidcConfigured && !testingOidc;
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
const missingFields = [
|
|
|
|
|
!form.oidc_issuer_url.trim() && 'Issuer URL',
|
|
|
|
|
!form.oidc_client_id.trim() && 'Client ID',
|
|
|
|
|
!secretAvailable && 'Client Secret',
|
|
|
|
|
!form.oidc_redirect_uri.trim() && 'Redirect URI',
|
|
|
|
|
].filter(Boolean);
|
|
|
|
|
const issuerEndpointWarning = looksLikeOidcEndpoint(form.oidc_issuer_url);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Card>
|
|
|
|
|
<CardHeader className="pb-4">
|
|
|
|
|
<div className="flex items-center justify-between gap-3">
|
|
|
|
|
<div>
|
|
|
|
|
<CardTitle>Authentication Methods</CardTitle>
|
|
|
|
|
<p className="text-sm text-muted-foreground mt-1">
|
|
|
|
|
Control local login and authentik/OIDC. Settings are saved in the database;
|
|
|
|
|
environment variables only fill blank fields as bootstrap defaults.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</CardHeader>
|
|
|
|
|
|
|
|
|
|
<CardContent className="space-y-5">
|
2026-07-04 21:26:22 -05:00
|
|
|
{((data?.warnings?.length ?? 0) > 0 || wouldLockOut || cantDisableLocal) && (
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
<div className="rounded-lg border border-amber-500/25 bg-amber-500/10 px-4 py-3 space-y-1">
|
|
|
|
|
{wouldLockOut && (
|
|
|
|
|
<p className="text-sm text-amber-600 dark:text-amber-400">
|
|
|
|
|
Cannot disable all login methods; at least one must remain enabled.
|
|
|
|
|
</p>
|
|
|
|
|
)}
|
|
|
|
|
{cantDisableLocal && !wouldLockOut && (
|
|
|
|
|
<p className="text-sm text-amber-600 dark:text-amber-400">
|
2026-07-06 14:23:53 -05:00
|
|
|
Cannot disable local login without authentik/OIDC configured, enabled, and mapped to
|
|
|
|
|
an admin group.
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
</p>
|
|
|
|
|
)}
|
|
|
|
|
{oidcEnabledButIncomplete && (
|
|
|
|
|
<p className="text-sm text-amber-600 dark:text-amber-400">
|
|
|
|
|
authentik/OIDC needs {missingFields.join(', ')} before it can be enabled.
|
|
|
|
|
</p>
|
|
|
|
|
)}
|
|
|
|
|
{data?.warnings?.map((w, i) => (
|
2026-07-06 14:23:53 -05:00
|
|
|
<p key={i} className="text-sm text-amber-600 dark:text-amber-400">
|
|
|
|
|
{w}
|
|
|
|
|
</p>
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
<FieldRow label="Local username/password login">
|
|
|
|
|
<div className="flex items-center gap-3">
|
2026-07-06 14:23:53 -05:00
|
|
|
<Toggle
|
|
|
|
|
checked={form.local_login_enabled}
|
|
|
|
|
onChange={(v) => set('local_login_enabled', v)}
|
|
|
|
|
label="Enable local login"
|
|
|
|
|
/>
|
|
|
|
|
<span className="text-xs text-muted-foreground">
|
|
|
|
|
{form.local_login_enabled ? 'Enabled' : 'Disabled'}
|
|
|
|
|
</span>
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
</div>
|
|
|
|
|
</FieldRow>
|
|
|
|
|
|
|
|
|
|
<FieldRow label="authentik / OIDC login">
|
|
|
|
|
<div className="flex items-center gap-3">
|
2026-07-06 14:23:53 -05:00
|
|
|
<Toggle
|
|
|
|
|
checked={form.oidc_login_enabled}
|
|
|
|
|
onChange={(v) => set('oidc_login_enabled', v)}
|
|
|
|
|
label="Enable OIDC login"
|
|
|
|
|
/>
|
|
|
|
|
<span
|
|
|
|
|
className={`text-xs ${oidcConfigured ? 'text-muted-foreground' : 'text-amber-500'}`}
|
|
|
|
|
>
|
|
|
|
|
{!oidcConfigured
|
|
|
|
|
? 'Not fully configured'
|
|
|
|
|
: form.oidc_login_enabled
|
|
|
|
|
? 'Enabled'
|
|
|
|
|
: 'Disabled'}
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</FieldRow>
|
|
|
|
|
|
|
|
|
|
<div className="space-y-4 pt-2 border-t border-border">
|
|
|
|
|
<div className="flex items-center gap-2 pt-1 text-sm font-medium text-muted-foreground">
|
2026-07-06 14:23:53 -05:00
|
|
|
<img
|
2026-07-10 19:10:42 -05:00
|
|
|
src={OIDC_ICON_URL}
|
2026-07-06 14:23:53 -05:00
|
|
|
alt=""
|
|
|
|
|
aria-hidden="true"
|
|
|
|
|
className="h-5 w-5 shrink-0 object-contain"
|
|
|
|
|
/>
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
<span>authentik / OIDC configuration</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<FieldRow label="Provider name">
|
2026-07-06 14:23:53 -05:00
|
|
|
<Input
|
|
|
|
|
value={form.oidc_provider_name}
|
|
|
|
|
onChange={(e) => set('oidc_provider_name', e.target.value)}
|
|
|
|
|
placeholder="authentik"
|
|
|
|
|
className="max-w-xs h-8 text-sm"
|
|
|
|
|
/>
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
</FieldRow>
|
|
|
|
|
|
|
|
|
|
<FieldRow label="Issuer / discovery URL">
|
|
|
|
|
<div className="space-y-1">
|
|
|
|
|
<Input
|
|
|
|
|
value={form.oidc_issuer_url}
|
2026-07-06 14:23:53 -05:00
|
|
|
onChange={(e) => set('oidc_issuer_url', e.target.value)}
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
placeholder="https://yourURL.com/application/o/bills/.well-known/openid-configuration"
|
|
|
|
|
className="max-w-xl h-8 text-sm"
|
|
|
|
|
/>
|
2026-07-06 14:23:53 -05:00
|
|
|
<p
|
|
|
|
|
className={
|
|
|
|
|
issuerEndpointWarning ? 'text-xs text-amber-500' : 'text-xs text-muted-foreground'
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
Use the authentik provider issuer URL or full discovery URL, for example
|
|
|
|
|
https://yourURL.com/application/o/bills/.well-known/openid-configuration.
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
</p>
|
|
|
|
|
{issuerEndpointWarning && (
|
|
|
|
|
<p className="text-xs text-amber-500">
|
2026-07-06 14:23:53 -05:00
|
|
|
This looks like an authorization endpoint. In authentik, copy the provider issuer
|
|
|
|
|
or OpenID Configuration URL.
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
</p>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
</FieldRow>
|
|
|
|
|
|
|
|
|
|
<FieldRow label="Client ID">
|
2026-07-06 14:23:53 -05:00
|
|
|
<Input
|
|
|
|
|
value={form.oidc_client_id}
|
|
|
|
|
onChange={(e) => set('oidc_client_id', e.target.value)}
|
|
|
|
|
placeholder="authentik client ID"
|
|
|
|
|
className="max-w-xl h-8 text-sm"
|
|
|
|
|
/>
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
</FieldRow>
|
|
|
|
|
|
|
|
|
|
<FieldRow label="Client Secret">
|
|
|
|
|
<div className="space-y-2">
|
|
|
|
|
<div className="flex max-w-xl items-center gap-3">
|
|
|
|
|
<Input
|
|
|
|
|
type="password"
|
|
|
|
|
value={form.oidc_client_secret}
|
2026-07-06 14:23:53 -05:00
|
|
|
onChange={(e) =>
|
|
|
|
|
setForm((prev) =>
|
|
|
|
|
prev
|
|
|
|
|
? {
|
|
|
|
|
...prev,
|
|
|
|
|
oidc_client_secret: e.target.value,
|
|
|
|
|
oidc_client_secret_clear: e.target.value
|
|
|
|
|
? false
|
|
|
|
|
: prev.oidc_client_secret_clear,
|
|
|
|
|
}
|
|
|
|
|
: prev,
|
|
|
|
|
)
|
|
|
|
|
}
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
placeholder="Leave blank to keep existing secret"
|
|
|
|
|
className="h-8 text-sm"
|
|
|
|
|
/>
|
2026-07-06 14:23:53 -05:00
|
|
|
<span
|
|
|
|
|
className={`shrink-0 text-xs ${data?.oidc_client_secret_set && !form.oidc_client_secret_clear ? 'text-emerald-500' : 'text-muted-foreground'}`}
|
|
|
|
|
>
|
|
|
|
|
{data?.oidc_client_secret_set && !form.oidc_client_secret_clear
|
|
|
|
|
? 'Secret is set'
|
|
|
|
|
: 'No secret saved'}
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
<label className="flex items-center gap-2 text-xs text-muted-foreground">
|
2026-07-06 14:23:53 -05:00
|
|
|
<input
|
|
|
|
|
type="checkbox"
|
|
|
|
|
checked={form.oidc_client_secret_clear}
|
|
|
|
|
onChange={(e) => set('oidc_client_secret_clear', e.target.checked)}
|
|
|
|
|
/>
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
Clear saved secret on save
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
</FieldRow>
|
|
|
|
|
|
|
|
|
|
<FieldRow label="Client auth method">
|
|
|
|
|
<div className="space-y-1">
|
|
|
|
|
<select
|
|
|
|
|
value={form.oidc_token_auth_method}
|
2026-07-06 14:23:53 -05:00
|
|
|
onChange={(e) => set('oidc_token_auth_method', e.target.value)}
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
className="h-8 rounded-md border border-input bg-background px-3 text-sm"
|
|
|
|
|
>
|
|
|
|
|
<option value="client_secret_basic">client_secret_basic</option>
|
|
|
|
|
<option value="client_secret_post">client_secret_post</option>
|
|
|
|
|
</select>
|
|
|
|
|
<p className="text-xs text-muted-foreground">
|
2026-07-06 14:23:53 -05:00
|
|
|
Advanced. Keep client_secret_basic unless your authentik provider explicitly
|
|
|
|
|
requires client_secret_post.
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</FieldRow>
|
|
|
|
|
|
|
|
|
|
<FieldRow label="Redirect URI">
|
|
|
|
|
<div className="space-y-1">
|
|
|
|
|
<div className="flex max-w-xl gap-2">
|
2026-07-06 14:23:53 -05:00
|
|
|
<Input
|
|
|
|
|
value={form.oidc_redirect_uri}
|
|
|
|
|
onChange={(e) => set('oidc_redirect_uri', e.target.value)}
|
|
|
|
|
placeholder={defaultOidcRedirectUri()}
|
|
|
|
|
className="h-8 text-sm"
|
|
|
|
|
/>
|
|
|
|
|
<Button
|
|
|
|
|
type="button"
|
|
|
|
|
variant="outline"
|
|
|
|
|
size="sm"
|
|
|
|
|
onClick={() => set('oidc_redirect_uri', defaultOidcRedirectUri())}
|
|
|
|
|
>
|
|
|
|
|
Use Current
|
|
|
|
|
</Button>
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
</div>
|
2026-07-06 14:23:53 -05:00
|
|
|
<p className="text-xs text-muted-foreground">
|
|
|
|
|
Add this exact URL to the Redirect URIs allowed by authentik.
|
|
|
|
|
</p>
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
</div>
|
|
|
|
|
</FieldRow>
|
|
|
|
|
|
|
|
|
|
<FieldRow label="Scopes">
|
2026-07-06 14:23:53 -05:00
|
|
|
<Input
|
|
|
|
|
value={form.oidc_scopes}
|
|
|
|
|
onChange={(e) => set('oidc_scopes', e.target.value)}
|
|
|
|
|
placeholder="openid email profile groups"
|
|
|
|
|
className="max-w-xl h-8 text-sm"
|
|
|
|
|
/>
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
</FieldRow>
|
|
|
|
|
|
|
|
|
|
<FieldRow label="Admin group">
|
|
|
|
|
<div className="space-y-1">
|
2026-07-06 14:23:53 -05:00
|
|
|
<Input
|
|
|
|
|
value={form.oidc_admin_group}
|
|
|
|
|
onChange={(e) => set('oidc_admin_group', e.target.value)}
|
|
|
|
|
placeholder="e.g. bill-tracker-admins"
|
|
|
|
|
className="max-w-sm h-8 text-sm"
|
|
|
|
|
/>
|
|
|
|
|
<p className="text-xs text-muted-foreground">
|
|
|
|
|
Only users in this authentik group become app admins. Admin is never granted by
|
|
|
|
|
default.
|
|
|
|
|
</p>
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
</div>
|
|
|
|
|
</FieldRow>
|
|
|
|
|
|
|
|
|
|
<FieldRow label="Auto-provision users">
|
|
|
|
|
<div className="space-y-1">
|
|
|
|
|
<div className="flex items-center gap-3">
|
2026-07-06 14:23:53 -05:00
|
|
|
<Toggle
|
|
|
|
|
checked={form.oidc_auto_provision}
|
|
|
|
|
onChange={(v) => set('oidc_auto_provision', v)}
|
|
|
|
|
label="Auto-provision users"
|
|
|
|
|
/>
|
|
|
|
|
<span className="text-xs text-muted-foreground">
|
|
|
|
|
{form.oidc_auto_provision ? 'Enabled' : 'Disabled'}
|
|
|
|
|
</span>
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
</div>
|
2026-07-06 14:23:53 -05:00
|
|
|
<p className="text-xs text-muted-foreground">
|
|
|
|
|
When enabled, valid authentik users are created in this app on first login.
|
|
|
|
|
</p>
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
</div>
|
|
|
|
|
</FieldRow>
|
|
|
|
|
|
|
|
|
|
<FieldRow label="Default role">
|
|
|
|
|
<div className="flex items-center gap-2">
|
|
|
|
|
<Input value="user" readOnly className="max-w-[120px] h-8 text-sm" />
|
2026-07-06 14:23:53 -05:00
|
|
|
<span className="text-xs text-muted-foreground">
|
|
|
|
|
Admin role only via admin group.
|
|
|
|
|
</span>
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
</div>
|
|
|
|
|
</FieldRow>
|
|
|
|
|
|
|
|
|
|
{data?.oidc_env_fallback_used && (
|
|
|
|
|
<div className="rounded-lg border border-sky-500/25 bg-sky-500/10 px-4 py-3 text-xs text-sky-700 dark:text-sky-400">
|
2026-07-06 14:23:53 -05:00
|
|
|
One or more blank database fields are currently using environment fallback values.
|
|
|
|
|
Saving values here takes precedence.
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{oidcTest && (
|
2026-07-06 14:23:53 -05:00
|
|
|
<div
|
|
|
|
|
className={`rounded-lg border px-4 py-3 text-xs ${
|
|
|
|
|
oidcTest.ok
|
|
|
|
|
? 'border-emerald-500/25 bg-emerald-500/10 text-emerald-700 dark:text-emerald-400'
|
|
|
|
|
: 'border-destructive/25 bg-destructive/10 text-destructive'
|
|
|
|
|
}`}
|
|
|
|
|
>
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
{oidcTest.ok
|
|
|
|
|
? `Configuration test passed for ${oidcTest.issuer || form.oidc_issuer_url}.`
|
|
|
|
|
: oidcTest.error || 'Configuration test failed.'}
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="pt-2 border-t border-border flex flex-wrap items-center gap-2">
|
|
|
|
|
<Button variant="outline" onClick={handleTestOidc} disabled={!canTestOidc}>
|
|
|
|
|
{testingOidc ? 'Testing…' : 'Test Configuration'}
|
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
variant="outline"
|
|
|
|
|
disabled={!data?.oidc_login_enabled || !data?.oidc_configured}
|
2026-07-06 14:23:53 -05:00
|
|
|
onClick={() => {
|
|
|
|
|
window.location.href = '/api/auth/oidc/login?redirect_to=/admin';
|
|
|
|
|
}}
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
>
|
2026-07-06 14:23:53 -05:00
|
|
|
<img
|
2026-07-10 19:10:42 -05:00
|
|
|
src={OIDC_ICON_URL}
|
2026-07-06 14:23:53 -05:00
|
|
|
alt=""
|
|
|
|
|
aria-hidden="true"
|
|
|
|
|
className="mr-2 h-4 w-4 shrink-0 object-contain"
|
|
|
|
|
/>
|
refactor: component splits, PWA support, CommandPalette
Component Splits:
- AdminPage.jsx: 1,906 -> 82 lines (logic moved to client/components/admin/ — 9 files)
- DataPage.jsx: 3,132 -> 60 lines (logic moved to client/components/data/ — 8 files)
- TrackerPage.jsx: 2,566 -> 2,132 lines (MonthlyStateDialog, StartingAmountsEditDialog, PaymentModal)
PWA:
- vite-plugin-pwa installed with NetworkFirst caching for API routes
- Square PWA icons (192x192, 512x512, apple-touch-icon)
- theme-color, apple meta tags, touch icon in index.html
- Build generates dist/sw.js + Workbox runtime
CommandPalette:
- Navigation commands, Add bill action, month jumps
- Grouped results with empty/filtered states
2026-05-28 20:53:22 -05:00
|
|
|
Test authentik Login
|
|
|
|
|
</Button>
|
|
|
|
|
<Button onClick={handleSave} disabled={!canSave}>
|
|
|
|
|
{saving ? 'Saving…' : 'Save Auth Settings'}
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
);
|
|
|
|
|
}
|