Skip to content

Commit

Permalink
Tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
agektmr committed Aug 27, 2024
1 parent a8eb7d6 commit bcdcb5b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/public/scripts/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ const registerCredential = async (opts: WebAuthnRegistrationObject): Promise<any
excludeCredentials,
} as PublicKeyCredentialCreationOptions;

console.log('[CreationOptions]', decodedOptions);
console.log('[CredentialCreationOptions]', decodedOptions);

// Create a new attestation.
const credential = await navigator.credentials.create({
Expand Down Expand Up @@ -532,7 +532,7 @@ const registerCredential = async (opts: WebAuthnRegistrationObject): Promise<any

const parsedCredential = await parseRegistrationCredential(credential);

console.log('[AttestationCredential]', encodedCredential);
console.log('[RegistrationResponseJSON]', parsedCredential);

// Verify and store the attestation.
await _fetch('/webauthn/registerResponse', encodedCredential);
Expand Down Expand Up @@ -569,7 +569,7 @@ const authenticate = async (opts: WebAuthnAuthenticationObject): Promise<any> =>
challenge,
} as PublicKeyCredentialRequestOptions;

console.log('[RequestOptions]', decodedOptions);
console.log('[CredentialRequestOptions]', decodedOptions);

// Authenticate the user.
const credential = await navigator.credentials.get({
Expand Down Expand Up @@ -606,7 +606,7 @@ const authenticate = async (opts: WebAuthnAuthenticationObject): Promise<any> =>
clientExtensionResults,
} as AuthenticationResponseJSON;

console.log('[AssertionCredential]', encodedCredential);
console.log('[AuthenticationResponseJSON]', encodedCredential);

// Verify and store the credential.
return _fetch('/webauthn/authResponse', encodedCredential);
Expand Down
6 changes: 3 additions & 3 deletions src/public/scripts/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ const $: any = document.querySelector.bind(document);

const snackbar = $('#snackbar') as Snackbar;

async function viewPayload(
function showPayload(
payload: JSON
): Promise<void> {
): void {
$('#json-viewer').data = { payload };
$('#json-viewer').expandAll();
$('#payload-viewer').show();
Expand All @@ -38,7 +38,7 @@ function showSnackbar(message: string, payload?: any): void {
button.slot = 'action';
button.innerText = 'Show payload';
button.addEventListener('click', e => {
viewPayload(payload);
showPayload(payload);
});
snackbar.appendChild(button);
} else {
Expand Down

0 comments on commit bcdcb5b

Please sign in to comment.