diff --git a/src/public/scripts/main.ts b/src/public/scripts/main.ts index 46d22dd..ab0a316 100644 --- a/src/public/scripts/main.ts +++ b/src/public/scripts/main.ts @@ -491,7 +491,7 @@ const registerCredential = async (opts: WebAuthnRegistrationObject): Promise => challenge, } as PublicKeyCredentialRequestOptions; - console.log('[RequestOptions]', decodedOptions); + console.log('[CredentialRequestOptions]', decodedOptions); // Authenticate the user. const credential = await navigator.credentials.get({ @@ -606,7 +606,7 @@ const authenticate = async (opts: WebAuthnAuthenticationObject): Promise => clientExtensionResults, } as AuthenticationResponseJSON; - console.log('[AssertionCredential]', encodedCredential); + console.log('[AuthenticationResponseJSON]', encodedCredential); // Verify and store the credential. return _fetch('/webauthn/authResponse', encodedCredential); diff --git a/src/public/scripts/util.ts b/src/public/scripts/util.ts index 8089eac..273e599 100644 --- a/src/public/scripts/util.ts +++ b/src/public/scripts/util.ts @@ -22,9 +22,9 @@ const $: any = document.querySelector.bind(document); const snackbar = $('#snackbar') as Snackbar; -async function viewPayload( +function showPayload( payload: JSON -): Promise { +): void { $('#json-viewer').data = { payload }; $('#json-viewer').expandAll(); $('#payload-viewer').show(); @@ -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 {