File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,12 @@ import {
1010 RouteCreator ,
1111 RouteRegistrator ,
1212} from "../pkg"
13+ import { UiNodeInputAttributes } from "@ory/client"
1314import { UserSettingsScreen } from "@ory/elements-markup"
15+ import {
16+ filterNodesByGroups ,
17+ isUiNodeInputAttributes ,
18+ } from "@ory/integrations/ui"
1419
1520export const createSettingsRoute : RouteCreator =
1621 ( createHelpers ) => async ( req , res , next ) => {
@@ -67,6 +72,18 @@ export const createSettingsRoute: RouteCreator =
6772 nodes : flow . ui . nodes ,
6873 nav : settingsScreen . Nav ,
6974 settingsScreen : settingsScreen . Body ,
75+ webAuthnHandler : filterNodesByGroups ( {
76+ nodes : flow . ui . nodes ,
77+ groups : [ "webauthn" ] ,
78+ attributes : [ "button" ] ,
79+ withoutDefaultAttributes : true ,
80+ withoutDefaultGroup : true ,
81+ } )
82+ . filter ( ( { attributes } ) => isUiNodeInputAttributes ( attributes ) )
83+ . map ( ( { attributes } ) => {
84+ return ( attributes as UiNodeInputAttributes ) . onclick
85+ } )
86+ . filter ( ( c ) => c !== undefined ) ,
7087 } )
7188 } )
7289 . catch ( redirectOnSoftError ( res , next , initFlowUrl ) )
Original file line number Diff line number Diff line change 1212
1313<script type =" text/javascript" >
1414 document .getElementsByName (" {{webauthnTriggerName}}" ).forEach ((v ) => {
15- console .log (" attaching event listener" )
1615 v .addEventListener (" click" , () => {
17- console .log (" clicked" );
1816 {{{webAuthnHandler}}}
1917 })
2018 })
You can’t perform that action at this time.
0 commit comments