File tree 8 files changed +14
-60
lines changed
8 files changed +14
-60
lines changed Original file line number Diff line number Diff line change @@ -173,18 +173,6 @@ export const createLoginRoute: RouteCreator =
173
173
174
174
res . render ( "login" , {
175
175
nodes : flow . ui . nodes ,
176
- webAuthnHandler : filterNodesByGroups ( {
177
- nodes : flow . ui . nodes ,
178
- groups : [ "webauthn" , "passkey" ] ,
179
- attributes : [ "button" ] ,
180
- withoutDefaultAttributes : true ,
181
- withoutDefaultGroup : true ,
182
- } )
183
- . filter ( ( { attributes } ) => isUiNodeInputAttributes ( attributes ) )
184
- . map ( ( { attributes } ) => {
185
- return ( attributes as UiNodeInputAttributes ) . onclick
186
- } )
187
- . filter ( ( c ) => c !== undefined ) ,
188
176
card : UserAuthCard (
189
177
{
190
178
flow,
Original file line number Diff line number Diff line change @@ -79,21 +79,9 @@ export const createRegistrationRoute: RouteCreator =
79
79
flow . oauth2_login_request . challenge ,
80
80
)
81
81
}
82
- const webAuthnHandler = filterNodesByGroups ( {
83
- nodes : flow . ui . nodes ,
84
- groups : [ "webauthn" , "passkey" ] ,
85
- attributes : [ "button" ] ,
86
- withoutDefaultAttributes : true ,
87
- withoutDefaultGroup : true ,
88
- } )
89
- . filter ( ( { attributes } ) => isUiNodeInputAttributes ( attributes ) )
90
- . map ( ( { attributes } ) => {
91
- return ( attributes as UiNodeInputAttributes ) . onclick
92
- } )
93
- . filter ( ( onClickAction ) => ! ! onClickAction )
82
+
94
83
res . render ( "registration" , {
95
84
nodes : flow . ui . nodes ,
96
- webAuthnHandler : webAuthnHandler ,
97
85
card : UserAuthCard (
98
86
{
99
87
flow,
Original file line number Diff line number Diff line change @@ -77,18 +77,6 @@ export const createSettingsRoute: RouteCreator =
77
77
nodes : flow . ui . nodes ,
78
78
nav : settingsScreen . Nav ,
79
79
settingsScreen : settingsScreen . Body ,
80
- webAuthnHandler : filterNodesByGroups ( {
81
- nodes : flow . ui . nodes ,
82
- groups : [ "webauthn" , "passkey" ] ,
83
- attributes : [ "button" ] ,
84
- withoutDefaultAttributes : true ,
85
- withoutDefaultGroup : true ,
86
- } )
87
- . filter ( ( { attributes } ) => isUiNodeInputAttributes ( attributes ) )
88
- . map ( ( { attributes } ) => {
89
- return ( attributes as UiNodeInputAttributes ) . onclick
90
- } )
91
- . filter ( ( c ) => c !== undefined ) ,
92
80
} )
93
81
} )
94
82
. catch ( redirectOnSoftError ( res , next , initFlowUrl ) )
Original file line number Diff line number Diff line change 1
1
<div id =" login" >
2
2
{{{ card }}}
3
3
4
- {{> webauthn_setup nodes =nodes webAuthnHandler =webAuthnHandler webauthnTriggerName =" webauthn_login_trigger" }}
5
4
{{> js_setup nodes =nodes }}
6
5
{{ #if extraPartial }}
7
6
{{> (extraPartial ) }}
Original file line number Diff line number Diff line change
1
+ {{! This inserts the webauthn.js script tag}}
2
+ {{ #each (onlyNodes nodes " webauthn" " text/javascript" )}}
3
+ <script
4
+ src =" {{ attributes.src }} "
5
+ type =" {{ attributes.type }} "
6
+ integrity =" {{ attributes.integrity }} "
7
+ referrerpolicy =" {{ attributes.referrerpolicy }} "
8
+ crossorigin =" {{ attributes.crossorigin }} "
9
+ {{ #if attributes.async }} async{{ /if }}
10
+ data-testid =" node/script/{{ attributes.id }} "
11
+ ></script >
12
+ {{ /each }}
1
13
{{! This partial sets up the onclick and onload event handlers for each passkey node.}}
2
14
<script type =" text/javascript" >
3
15
// register onclick and onload event handlers for each passkey node.
4
16
window .addEventListener (" load" , () => {
5
- {{#each (onlyNodes nodes " passkey" " " )}}
17
+ {{#each (onlyNodes nodes " passkey,webauthn " " " )}}
6
18
{{#if attributes .onclick }}
7
19
// onclick for {{attributes.name}}
8
20
document .getElementsByName (" {{attributes.name}}" ).forEach ((el ) => {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 2
2
3
3
{{{ card }}}
4
4
5
- {{> webauthn_setup nodes =nodes webAuthnHandler =webAuthnHandler webauthnTriggerName =" webauthn_register_trigger" }}
6
5
{{> js_setup nodes =nodes }}
7
6
{{ #if extraPartial }}
8
7
{{> (extraPartial ) }}
Original file line number Diff line number Diff line change 4
4
{{{ settingsScreen }}}
5
5
</div >
6
6
7
- {{> webauthn_setup nodes =nodes webAuthnHandler =webAuthnHandler webauthnTriggerName =" webauthn_register_trigger" }}
8
7
{{> js_setup nodes =nodes }}
9
8
</div >
You can’t perform that action at this time.
0 commit comments