From 7dc45631cf1f6e00137d2bb3aeaa455b8a330fbf Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Mon, 17 Mar 2025 11:19:51 +0100 Subject: [PATCH] fix(core): adjust fronend code for changes in webauthn library Signed-off-by: Ferdinand Thiessen --- .../src/service/WebAuthnRegistrationSerice.ts | 6 +- .../login/PasswordLessLoginForm.vue | 59 ++++++++++--------- .../services/WebAuthnAuthenticationService.ts | 2 +- 3 files changed, 36 insertions(+), 31 deletions(-) diff --git a/apps/settings/src/service/WebAuthnRegistrationSerice.ts b/apps/settings/src/service/WebAuthnRegistrationSerice.ts index 7e881ce61e2..8f9e085310c 100644 --- a/apps/settings/src/service/WebAuthnRegistrationSerice.ts +++ b/apps/settings/src/service/WebAuthnRegistrationSerice.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -import type { RegistrationResponseJSON } from '@simplewebauthn/types' +import type { PublicKeyCredentialCreationOptionsJSON, RegistrationResponseJSON } from '@simplewebauthn/types' import { translate as t } from '@nextcloud/l10n' import { generateUrl } from '@nextcloud/router' @@ -21,9 +21,9 @@ export async function startRegistration() { try { logger.debug('Fetching webauthn registration data') - const { data } = await axios.get(url) + const { data } = await axios.get(url) logger.debug('Start webauthn registration') - const attrs = await registerWebAuthn(data) + const attrs = await registerWebAuthn({ optionsJSON: data }) return attrs } catch (e) { logger.error(e as Error) diff --git a/core/src/components/login/PasswordLessLoginForm.vue b/core/src/components/login/PasswordLessLoginForm.vue index 04db5cef05a..f6966222a60 100644 --- a/core/src/components/login/PasswordLessLoginForm.vue +++ b/core/src/components/login/PasswordLessLoginForm.vue @@ -5,24 +5,27 @@ - diff --git a/core/src/services/WebAuthnAuthenticationService.ts b/core/src/services/WebAuthnAuthenticationService.ts index 82a07ae35ad..7563e264109 100644 --- a/core/src/services/WebAuthnAuthenticationService.ts +++ b/core/src/services/WebAuthnAuthenticationService.ts @@ -27,7 +27,7 @@ export async function startAuthentication(loginName: string) { logger.error('No valid credentials returned for webauthn') throw new NoValidCredentials() } - return await startWebauthnAuthentication(data) + return await startWebauthnAuthentication({ optionsJSON: data }) } /**