diff --git a/frontend/src/lib/utils/event-util.ts b/frontend/src/lib/utils/event-util.ts new file mode 100644 index 00000000..55bdf531 --- /dev/null +++ b/frontend/src/lib/utils/event-util.ts @@ -0,0 +1,6 @@ +export function preventDefault(fn: (event: Event) => void): (event: Event) => void { + return function (this: unknown, event) { + event.preventDefault(); + fn.call(this, event); + }; +} diff --git a/frontend/src/routes/device/+page.svelte b/frontend/src/routes/device/+page.svelte index cc5dccd0..230b9bee 100644 --- a/frontend/src/routes/device/+page.svelte +++ b/frontend/src/routes/device/+page.svelte @@ -11,6 +11,7 @@ import userStore from '$lib/stores/user-store'; import type { OidcDeviceCodeInfo } from '$lib/types/oidc.type'; import { getAxiosErrorMessage } from '$lib/utils/error-util'; + import { preventDefault } from '$lib/utils/event-util'; import { startAuthentication } from '@simplewebauthn/browser'; import { onMount } from 'svelte'; import { slide } from 'svelte/transition'; @@ -105,7 +106,7 @@ {:else}
{m.enter_code_displayed_in_previous_step()}
- {/if} diff --git a/frontend/src/routes/login/alternative/code/+page.svelte b/frontend/src/routes/login/alternative/code/+page.svelte index f8ff7ba7..12b7a884 100644 --- a/frontend/src/routes/login/alternative/code/+page.svelte +++ b/frontend/src/routes/login/alternative/code/+page.svelte @@ -1,15 +1,16 @@ -