DEV: Add error message styling (#21225)

To security key errors when confirming new email.
This commit is contained in:
Penar Musaraj 2023-04-25 08:40:18 -04:00 committed by GitHub
parent a052ecee62
commit b59e0b22f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -13,10 +13,14 @@ if (security) {
document.getElementById("security-key-credential").value =
JSON.stringify(credentialData);
$(e.target).parents("form").submit();
e.target.closest("form").submit();
},
(errorMessage) => {
document.getElementById("security-key-error").innerText = errorMessage;
document.getElementById(
"security-key-error"
).innerHTML = `<div class="alert alert-error"></div>`;
document.querySelector("#security-key-error .alert").innerText =
errorMessage;
}
);
};