/passkeys/registration/begin GET => POST

This commit is contained in:
Manav Rathi
2024-06-10 16:35:10 +05:30
parent fc826e8acb
commit b9d4f9ff10
3 changed files with 4 additions and 3 deletions

View File

@@ -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{

View File

@@ -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}`);

View File

@@ -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