From 6abf68261cb6e8806a512fafeefa45757fdbd114 Mon Sep 17 00:00:00 2001 From: Jacky Date: Sat, 23 Nov 2024 20:56:38 +0800 Subject: [PATCH] fix: webauthn cannot register #753 --- api/user/passkey.go | 2 +- app/src/views/preference/components/AddPasskey.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/user/passkey.go b/api/user/passkey.go index 55bb1e8e..3c698456 100644 --- a/api/user/passkey.go +++ b/api/user/passkey.go @@ -45,7 +45,7 @@ func BeginPasskeyRegistration(c *gin.Context) { } cache.Set(buildCachePasskeyRegKey(u.ID), sessionData, passkeyTimeout) - c.JSON(http.StatusOK, options) + c.JSON(http.StatusOK, options.Response) } func FinishPasskeyRegistration(c *gin.Context) { diff --git a/app/src/views/preference/components/AddPasskey.vue b/app/src/views/preference/components/AddPasskey.vue index c60718af..50b51da8 100644 --- a/app/src/views/preference/components/AddPasskey.vue +++ b/app/src/views/preference/components/AddPasskey.vue @@ -15,9 +15,9 @@ const regLoading = ref(false) async function registerPasskey() { regLoading.value = true try { - const options = await passkey.begin_registration() + const optionsJSON = await passkey.begin_registration() - const attestationResponse = await startRegistration(options.publicKey) + const attestationResponse = await startRegistration({ optionsJSON }) await passkey.finish_registration(attestationResponse, passkeyName.value)