Skip to content

Commit

Permalink
set publicKey to null if getPublicKey returns null
Browse files Browse the repository at this point in the history
  • Loading branch information
Keroosha committed Jun 4, 2024
1 parent 719e99b commit 5b6b410
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions demo/WebAuthn.Net.Demo.Mvc/wwwroot/js/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ const API = {
if (newCredential.response.getPublicKey) {
const responsePublicKey = newCredential.response.getPublicKey();
const isValid = responsePublicKey instanceof ArrayBuffer;
if (!isValid) {
Alerts.getPublicKeyInvalid();
return;
if (isValid) {
publicKey = coerceToBase64Url(responsePublicKey);
} else {
publicKey = null;
}
publicKey = coerceToBase64Url(responsePublicKey);
}

const transports = newCredential.response.getTransports ?
Expand Down

0 comments on commit 5b6b410

Please sign in to comment.