feat: move totp and passkeys into plugins (C1)

This commit is contained in:
LukeGus committed 2026-09-24 16:57:24 -05:00
1 parent f4f26a9b8b
commit 5c18435105
235 files changed
+22545 -5610

No files matched your search

+49
View File
@@ -42,6 +42,12 @@ import {
listSettingsComponents,
} from "@/settings/settings-components";
import { getSlotContributions, listActions } from "@/shell/action-registry";
import {
getLoginMethodUI,
getSecondFactorUI,
listLoginMethodUIs,
listSecondFactorUIs,
} from "./auth-registry";
import { ActionSlot, ComponentSlot } from "@/shell/ActionSlot";
import type { Host, Tab } from "@/types/ui-types";
import { createPluginApp } from "./app";
@@ -223,6 +229,9 @@ export async function renderPlugin(
(contribution) => contribution.actionId,
),
actions: () => mine(listActions()).map((action) => action.id),
loginMethods: () => mine(listLoginMethodUIs()).map((method) => method.id),
secondFactors: () =>
mine(listSecondFactorUIs()).map((factor) => factor.id),
},
renderTab(type, props = {}) {
@@ -315,6 +324,46 @@ export async function renderPlugin(
);
},
renderLoginMethod(id, props = {}) {
const method = getLoginMethodUI(id) ?? missing("a login method", id);
const Component = method.component;
return wrap(
<Component
methodId={id}
instances={[]}
rememberMe={false}
disabled={false}
submit={async () => {}}
startRedirect={async () => {}}
complete={async () => {}}
{...props}
/>,
);
},
renderSecondFactor(id, props = {}) {
const factor = getSecondFactorUI(id) ?? missing("a second factor", id);
const Component = factor.component;
return wrap(
<Component
factorId={id}
rememberMe={false}
disabled={false}
verify={async () => {}}
challenge={async () => null}
cancel={() => {}}
{...props}
/>,
);
},
renderEnrollment(id) {
const entry = getSecondFactorUI(id) ?? getLoginMethodUI(id);
const Component =
entry?.enrollment ?? missing("an enrolment section", id);
return wrap(<Component />);
},
renderSlot(slotId, props = {}) {
return wrap(
<>