From e5203f9af27bacf2fd2a1ab1c01c13935caddfa4 Mon Sep 17 00:00:00 2001 From: Henning Perl Date: Tue, 9 Jan 2024 12:15:02 +0100 Subject: [PATCH] feat: add onload js setup --- nodemon.json | 5 +---- views/login.hbs | 1 + views/partials/js_setup.hbs | 18 ++++++++++++++++++ views/registration.hbs | 1 + views/settings.hbs | 2 +- 5 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 views/partials/js_setup.hbs diff --git a/nodemon.json b/nodemon.json index e001b5f8..f47bb65e 100644 --- a/nodemon.json +++ b/nodemon.json @@ -7,9 +7,6 @@ "COOKIE_SECRET": "I_AM_VERY_SECRET", "CSRF_COOKIE_SECRET": "I_AM_VERY_SECRET_TOO", "DANGEROUSLY_DISABLE_SECURE_CSRF_COOKIES": "true", - "ORY_SDK_URL": "http://localhost:4433", - "KRATOS_PUBLIC_URL": "http://localhost:4433", - "KRATOS_ADMIN_URL": "http://localhost:4434", - "PORT": "4455" + "ORY_SDK_URL": "http://localhost:4433" } } diff --git a/views/login.hbs b/views/login.hbs index 79c5b658..e0a962b9 100644 --- a/views/login.hbs +++ b/views/login.hbs @@ -2,6 +2,7 @@ {{{card}}} {{> webauthn_setup nodes=nodes webAuthnHandler=webAuthnHandler webauthnTriggerName="webauthn_login_trigger"}} + {{> js_setup nodes=nodes}} {{#if extraPartial }} {{> (extraPartial) }} {{/if}} diff --git a/views/partials/js_setup.hbs b/views/partials/js_setup.hbs new file mode 100644 index 00000000..de9decd0 --- /dev/null +++ b/views/partials/js_setup.hbs @@ -0,0 +1,18 @@ +{{! This partial sets up the onclick and onload event handlers for each passkey node.}} + diff --git a/views/registration.hbs b/views/registration.hbs index c1f32e68..38c438f2 100644 --- a/views/registration.hbs +++ b/views/registration.hbs @@ -3,6 +3,7 @@ {{{card}}} {{> webauthn_setup nodes=nodes webAuthnHandler=webAuthnHandler webauthnTriggerName="webauthn_register_trigger"}} + {{> js_setup nodes=nodes}} {{#if extraPartial }} {{> (extraPartial) }} {{/if}} diff --git a/views/settings.hbs b/views/settings.hbs index c14c7cfe..547d044e 100644 --- a/views/settings.hbs +++ b/views/settings.hbs @@ -5,5 +5,5 @@ {{> webauthn_setup nodes=nodes webAuthnHandler=webAuthnHandler webauthnTriggerName="webauthn_register_trigger"}} - + {{> js_setup nodes=nodes}}