From a0e22036c8dfa36570ee4cf7f0b6e9f7acc54315 Mon Sep 17 00:00:00 2001 From: Jake Howard <6527489+RealOrangeOne@users.noreply.github.com> Date: Sun, 18 May 2025 12:22:04 +0100 Subject: [PATCH] refactor: update options API for simplewebauthn (#543) --- frontend/src/routes/authorize/+page.svelte | 2 +- frontend/src/routes/device/+page.svelte | 2 +- frontend/src/routes/login/+page.svelte | 2 +- frontend/src/routes/settings/account/+page.svelte | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/routes/authorize/+page.svelte b/frontend/src/routes/authorize/+page.svelte index fdae5ca7..a735dc4c 100644 --- a/frontend/src/routes/authorize/+page.svelte +++ b/frontend/src/routes/authorize/+page.svelte @@ -40,7 +40,7 @@ // Get access token if not signed in if (!$userStore?.id) { const loginOptions = await webauthnService.getLoginOptions(); - const authResponse = await startAuthentication(loginOptions); + const authResponse = await startAuthentication({optionsJSON: loginOptions}); const user = await webauthnService.finishLogin(authResponse); userStore.setUser(user); } diff --git a/frontend/src/routes/device/+page.svelte b/frontend/src/routes/device/+page.svelte index 8eaf251f..1512ee23 100644 --- a/frontend/src/routes/device/+page.svelte +++ b/frontend/src/routes/device/+page.svelte @@ -41,7 +41,7 @@ // Get access token if not signed in if (!$userStore) { const loginOptions = await webauthnService.getLoginOptions(); - const authResponse = await startAuthentication(loginOptions); + const authResponse = await startAuthentication({optionsJSON: loginOptions}); const user = await webauthnService.finishLogin(authResponse); userStore.setUser(user); } diff --git a/frontend/src/routes/login/+page.svelte b/frontend/src/routes/login/+page.svelte index f118dfaf..285c3626 100644 --- a/frontend/src/routes/login/+page.svelte +++ b/frontend/src/routes/login/+page.svelte @@ -20,7 +20,7 @@ isLoading = true; try { const loginOptions = await webauthnService.getLoginOptions(); - const authResponse = await startAuthentication(loginOptions); + const authResponse = await startAuthentication({optionsJSON: loginOptions}); const user = await webauthnService.finishLogin(authResponse); userStore.setUser(user); diff --git a/frontend/src/routes/settings/account/+page.svelte b/frontend/src/routes/settings/account/+page.svelte index c1776ce1..47680021 100644 --- a/frontend/src/routes/settings/account/+page.svelte +++ b/frontend/src/routes/settings/account/+page.svelte @@ -49,7 +49,7 @@ async function createPasskey() { try { const opts = await webauthnService.getRegistrationOptions(); - const attResp = await startRegistration(opts); + const attResp = await startRegistration({optionsJSON: opts}); const passkey = await webauthnService.finishRegistration(attResp); passkeys = await webauthnService.listCredentials();