diff --git a/src/routes/settings.ts b/src/routes/settings.ts index 86d62cb6..aa73b9fb 100644 --- a/src/routes/settings.ts +++ b/src/routes/settings.ts @@ -10,7 +10,12 @@ import { RouteCreator, RouteRegistrator, } from "../pkg" +import { UiNodeInputAttributes } from "@ory/client" import { UserSettingsScreen } from "@ory/elements-markup" +import { + filterNodesByGroups, + isUiNodeInputAttributes, +} from "@ory/integrations/ui" export const createSettingsRoute: RouteCreator = (createHelpers) => async (req, res, next) => { @@ -67,6 +72,18 @@ export const createSettingsRoute: RouteCreator = nodes: flow.ui.nodes, nav: settingsScreen.Nav, settingsScreen: settingsScreen.Body, + webAuthnHandler: filterNodesByGroups({ + nodes: flow.ui.nodes, + groups: ["webauthn"], + attributes: ["button"], + withoutDefaultAttributes: true, + withoutDefaultGroup: true, + }) + .filter(({ attributes }) => isUiNodeInputAttributes(attributes)) + .map(({ attributes }) => { + return (attributes as UiNodeInputAttributes).onclick + }) + .filter((c) => c !== undefined), }) }) .catch(redirectOnSoftError(res, next, initFlowUrl)) diff --git a/views/partials/webauthn_setup.hbs b/views/partials/webauthn_setup.hbs index 4abe9a81..02ef2e47 100644 --- a/views/partials/webauthn_setup.hbs +++ b/views/partials/webauthn_setup.hbs @@ -12,9 +12,7 @@