Skip to content

Commit

Permalink
Fix up top level
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishwillee committed Oct 13, 2023
1 parent 3a8a2f3 commit b04c8fd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions files/en-us/web/api/publickeycredential/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ The **`PublicKeyCredential`** interface provides information about a public key
- {{domxref("PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable_static", "PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()")}} {{securecontext_inline}}
- : Returns a {{jsxref("Promise")}} which resolves to `true` if an authenticator bound to the platform is capable of _verifying_ the user.
- {{domxref("PublicKeyCredential.parseCreationOptionsFromJSON_static", "PublicKeyCredential.parseCreationOptionsFromJSON()")}} {{experimental_inline}}{{securecontext_inline}}
- : Convenience method for deserializing server-sent credential registration data when [registering a user with credentials](/en-US/docs/Web/API/Web_Authentication_API#creating_a_key_pair_and_registering_a_user) (creating a [credential options object](/en-US/docs/Web/API/CredentialsContainer/create#publickey_object_structure) from a server-supplied JSON string).
- : Convenience method for deserializing server-sent credential registration data when [registering a user with credentials](/en-US/docs/Web/API/Web_Authentication_API#creating_a_key_pair_and_registering_a_user).
- {{domxref("PublicKeyCredential.parseRequestOptionsFromJSON_static", "PublicKeyCredential.parseRequestOptionsFromJSON()")}} {{experimental_inline}}{{securecontext_inline}}
- : Convenience method for deserializing server-sent credential request data when [authenticating a (registered) user](/en-US/docs/Web/API/Web_Authentication_API#authenticating_a_user) (creating a [credential request options object](/en-US/docs/Web/API/CredentialsContainer/get#publickey_object_structure) from a server-supplied JSON string).
- : Convenience method for deserializing server-sent credential request data when [authenticating a (registered) user](/en-US/docs/Web/API/Web_Authentication_API#authenticating_a_user).

## Instance methods

Expand All @@ -55,7 +55,7 @@ The **`PublicKeyCredential`** interface provides information about a public key
Here, we use {{domxref("CredentialsContainer.create()","navigator.credentials.create()")}} to generate a new credential.

```js
const publicKey = {
const createCredentialOptions = {
challenge: new Uint8Array([
21, 31, 105 /* 29 more random bytes generated by the server */,
]),
Expand All @@ -77,7 +77,7 @@ const publicKey = {
};

navigator.credentials
.create({ publicKey })
.create({ createCredentialOptions })
.then((newCredentialInfo) => {
const response = newCredentialInfo.response;
const clientExtensionsResults =
Expand All @@ -93,14 +93,14 @@ navigator.credentials
Here, we fetch an existing credential from an authenticator, using {{domxref("CredentialsContainer.get()","navigator.credentials.get()")}}.

```js
const options = {
const requestCredentialOptions = {
challenge: new Uint8Array([
/* bytes sent from the server */
]),
};

navigator.credentials
.get({ publicKey: options })
.get({ requestCredentialOptions })
.then((credentialInfoAssertion) => {
// send assertion response back to the server
// to proceed with the control of the credential
Expand Down

0 comments on commit b04c8fd

Please sign in to comment.