mirror of
https://github.com/zitadel/zitadel.git
synced 2025-11-16 07:53:18 +00:00
fix(login): improve webauthn error handling (#9474)
This PR improves error handling around webauthn functions in the login.
(cherry picked from commit a82f5805b6)
This commit is contained in:
committed by
Livio Spring
parent
122b5f3e0e
commit
52bb9ca3a5
@@ -15,7 +15,17 @@ function checkWebauthnSupported(button, func) {
|
||||
|
||||
function webauthnError(error) {
|
||||
let err = document.getElementById("wa-error");
|
||||
err.getElementsByClassName("cause")[0].innerText = error.message;
|
||||
let causeElement = err.getElementsByClassName("cause")[0];
|
||||
|
||||
if (error.message) {
|
||||
causeElement.innerText = error.message;
|
||||
} else if (error.value) {
|
||||
causeElement.innerText = error.value;
|
||||
} else {
|
||||
console.error("Unknown error:", error);
|
||||
causeElement.innerText = "An unknown error occurred.";
|
||||
}
|
||||
|
||||
err.classList.remove("hidden");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user