mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-25 16:42:34 +00:00
fix: ignore errors caused by webauthn's conditional ui to avoid loop (#34101)
closes #33072
Signed-off-by: Fabian Aggeler <aggeler@ubique.ch>
(cherry picked from commit 04e8508aaa)
Co-authored-by: Fabian Aggeler <35527968+UBaggeler@users.noreply.github.com>
This commit is contained in:
@@ -4,7 +4,7 @@ import { returnSuccess, returnFailure } from "./webauthnAuthenticate.js";
|
||||
export function initAuthenticate(input) {
|
||||
// Check if WebAuthn is supported by this browser
|
||||
if (!window.PublicKeyCredential) {
|
||||
returnFailure(input.errmsg);
|
||||
// Fail silently as WebAuthn Conditional UI is not required
|
||||
return;
|
||||
}
|
||||
if (input.isUserIdentified || typeof PublicKeyCredential.isConditionalMediationAvailable === "undefined") {
|
||||
@@ -17,7 +17,7 @@ export function initAuthenticate(input) {
|
||||
function doAuthenticate(input) {
|
||||
// Check if WebAuthn is supported by this browser
|
||||
if (!window.PublicKeyCredential) {
|
||||
returnFailure(input.errmsg);
|
||||
// Fail silently as WebAuthn Conditional UI is not required
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -50,8 +50,8 @@ async function tryAutoFillUI(input) {
|
||||
try {
|
||||
const result = await doAuthenticate(input);
|
||||
returnSuccess(result);
|
||||
} catch (error) {
|
||||
returnFailure(error);
|
||||
} catch {
|
||||
// Fail silently as WebAuthn Conditional UI is not required
|
||||
}
|
||||
} else {
|
||||
document.getElementById("kc-form-passkey-button").style.display = 'block';
|
||||
|
||||
Reference in New Issue
Block a user