Skip to content

Commit 976b095

Browse files
Fixing some README Javascript Typo's
1 parent 7fdb57c commit 976b095

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

README

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -210,14 +210,14 @@ fetch(/* ... */) // Make the call that returns the credential
210210
publicKey: {
211211
...credentialCreateJson.publicKey,
212212

213-
challenge: base64urlToUint8Array(credentialCreateJson.publicKey.challenge),
213+
challenge: base64urlToUint8array(credentialCreateJson.publicKey.challenge),
214214
user: {
215215
...credentialCreateJson.publicKey.user,
216-
id: base64urlToUint8Array(credentialCreateJson.publicKey.user.id),
216+
id: base64urlToUint8array(credentialCreateJson.publicKey.user.id),
217217
},
218218
excludeCredentials: credentialCreateJson.publicKey.excludeCredentials.map(credential => ({
219219
...credential,
220-
id: base64urlToUint8Array(credential.id),
220+
id: base64urlToUint8array(credential.id),
221221
})),
222222

223223
// Warning: Extension inputs could also contain binary data that needs encoding
@@ -230,13 +230,13 @@ fetch(/* ... */) // Make the call that returns the credential
230230
type: publicKeyCredential.type,
231231
id: publicKeyCredential.id,
232232
response: {
233-
attestationObject: uint8arrayToBase64url(response.response.attestationObject),
234-
clientDataJSON: uint8arrayToBase64url(response.response.clientDataJSON),
235-
transports: response.response.getTransports() || [],
233+
attestationObject: uint8arrayToBase64url(publicKeyCredential.response.attestationObject),
234+
clientDataJSON: uint8arrayToBase64url(publicKeyCredential.response.clientDataJSON),
235+
transports: publicKeyCredential.response.getTransports() || [],
236236
},
237237

238238
// Warning: Client extension results could also contain binary data that needs encoding
239-
clientExtensionResults: response.getClientExtensionResults(),
239+
clientExtensionResults: publicKeyCredential.getClientExtensionResults(),
240240
}))
241241
.then(encodedResult =>
242242
fetch(/* ... */)); // Return encoded PublicKeyCredential to server
@@ -324,10 +324,10 @@ fetch(/* ... */) // Make the call that returns the credential
324324
allowCredentials: credentialGetJson.publicKey.allowCredentials
325325
&& credentialGetJson.publicKey.allowCredentials.map(credential => ({
326326
...credential,
327-
id: base64urlToUint8Array(credential.id),
327+
id: base64urlToUint8array(credential.id),
328328
})),
329329

330-
challenge: base64urlToUint8Array(credentialGetJson.publicKey.challenge),
330+
challenge: base64urlToUint8array(credentialGetJson.publicKey.challenge),
331331

332332
// Warning: Extension inputs could also contain binary data that needs encoding
333333
extensions: credentialGetJson.publicKey.extensions,
@@ -339,14 +339,14 @@ fetch(/* ... */) // Make the call that returns the credential
339339
type: publicKeyCredential.type,
340340
id: publicKeyCredential.id,
341341
response: {
342-
authenticatorData: uint8arrayToBase64url(response.response.authenticatorData),
343-
clientDataJSON: uint8arrayToBase64url(response.response.clientDataJSON),
344-
signature: uint8arrayToBase64url(response.response.signature),
345-
userHandle: response.response.userHandle && uint8arrayToBase64url(response.response.userHandle),
342+
authenticatorData: uint8arrayToBase64url(publicKeyCredential.response.authenticatorData),
343+
clientDataJSON: uint8arrayToBase64url(publicKeyCredential.response.clientDataJSON),
344+
signature: uint8arrayToBase64url(publicKeyCredential.response.signature),
345+
userHandle: publicKeyCredential.response.userHandle && uint8arrayToBase64url(publicKeyCredential.response.userHandle),
346346
},
347347

348348
// Warning: Client extension results could also contain binary data that needs encoding
349-
clientExtensionResults: response.getClientExtensionResults(),
349+
clientExtensionResults: publicKeyCredential.getClientExtensionResults(),
350350
}))
351351
.then(encodedResult =>
352352
fetch(/* ... */)); // Return encoded PublicKeyCredential to server

0 commit comments

Comments
 (0)