1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 01:03:35 +00:00

Change WebAuthn connectors from using inline onclick to external (#969)

This commit is contained in:
Oscar Hinton
2021-05-12 17:19:20 +02:00
committed by GitHub
parent 51f3fee75d
commit a3506e833a
4 changed files with 9 additions and 10 deletions

View File

@@ -9,7 +9,9 @@ document.addEventListener('DOMContentLoaded', () => {
const text = getQsParam('btnText');
if (text) {
document.getElementById('webauthn-button').innerText = decodeURI(text);
const button = document.getElementById('webauthn-button');
button.innerText = decodeURI(text);
button.onclick = executeWebAuthn;
}
});
@@ -76,8 +78,6 @@ function executeWebAuthn() {
.catch(err => error('WebAuth Error: ' + err));
}
(window as any).executeWebAuthn = executeWebAuthn;
function onMessage() {
window.addEventListener('message', event => {
if (!event.origin || event.origin === '' || event.origin !== parentOrigin) {