diff --git a/server/cmd/museum/main.go b/server/cmd/museum/main.go index 8ccb43cc09..0656f12e61 100644 --- a/server/cmd/museum/main.go +++ b/server/cmd/museum/main.go @@ -487,7 +487,7 @@ func main() { accountsJwtAuthAPI.GET("/passkeys", passkeysHandler.GetPasskeys) accountsJwtAuthAPI.PATCH("/passkeys/:passkeyID", passkeysHandler.RenamePasskey) accountsJwtAuthAPI.DELETE("/passkeys/:passkeyID", passkeysHandler.DeletePasskey) - accountsJwtAuthAPI.GET("/passkeys/registration/begin", passkeysHandler.BeginRegistration) + accountsJwtAuthAPI.POST("/passkeys/registration/begin", passkeysHandler.BeginRegistration) accountsJwtAuthAPI.POST("/passkeys/registration/finish", passkeysHandler.FinishRegistration) collectionHandler := &api.CollectionHandler{ diff --git a/web/apps/accounts/src/services/passkey.ts b/web/apps/accounts/src/services/passkey.ts index 9318b4a67b..01df897d6d 100644 --- a/web/apps/accounts/src/services/passkey.ts +++ b/web/apps/accounts/src/services/passkey.ts @@ -143,6 +143,7 @@ interface BeginPasskeyRegistrationResponse { const beginPasskeyRegistration = async () => { const url = `${apiOrigin()}/passkeys/registration/begin`; const res = await fetch(url, { + method: "POST", headers: accountsAuthenticatedRequestHeaders(), }); if (!res.ok) throw new Error(`Failed to fetch ${url}: HTTP ${res.status}`); diff --git a/web/docs/webauthn-passkeys.md b/web/docs/webauthn-passkeys.md index 38c8f488d9..465af26726 100644 --- a/web/docs/webauthn-passkeys.md +++ b/web/docs/webauthn-passkeys.md @@ -107,7 +107,7 @@ func (u *PasskeyUser) WebAuthnCredentials() []webauthn.Credential { } ``` -#### GET /passkeys/registration/begin +#### POST /passkeys/registration/begin ##### Headers @@ -348,7 +348,7 @@ window.location.href = `${accountsAppURL()}/passkeys/verify?passkeySessionID=${p ### Requesting publicKey options (begin) -#### GET /users/two-factor/passkeys/begin +#### POST /users/two-factor/passkeys/begin ##### Query parameters