From 04e8508aaa48592b202a7d5a1c8737065b8435fa Mon Sep 17 00:00:00 2001 From: Fabian Aggeler <35527968+UBaggeler@users.noreply.github.com> Date: Thu, 10 Oct 2024 19:16:10 +0200 Subject: [PATCH] fix: ignore errors caused by webauthn's conditional ui to avoid loop closes #33072 Signed-off-by: Fabian Aggeler --- .../base/login/resources/js/passkeysConditionalAuth.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/themes/src/main/resources/theme/base/login/resources/js/passkeysConditionalAuth.js b/themes/src/main/resources/theme/base/login/resources/js/passkeysConditionalAuth.js index f94e26ee98..20ae676f2f 100644 --- a/themes/src/main/resources/theme/base/login/resources/js/passkeysConditionalAuth.js +++ b/themes/src/main/resources/theme/base/login/resources/js/passkeysConditionalAuth.js @@ -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';