fix: ignore errors caused by webauthn's conditional ui to avoid loop
closes #33072 Signed-off-by: Fabian Aggeler <aggeler@ubique.ch>
This commit is contained in:
parent
23a6822715
commit
04e8508aaa
1 changed files with 4 additions and 4 deletions
|
@ -4,7 +4,7 @@ import { returnSuccess, returnFailure } from "./webauthnAuthenticate.js";
|
||||||
export function initAuthenticate(input) {
|
export function initAuthenticate(input) {
|
||||||
// Check if WebAuthn is supported by this browser
|
// Check if WebAuthn is supported by this browser
|
||||||
if (!window.PublicKeyCredential) {
|
if (!window.PublicKeyCredential) {
|
||||||
returnFailure(input.errmsg);
|
// Fail silently as WebAuthn Conditional UI is not required
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (input.isUserIdentified || typeof PublicKeyCredential.isConditionalMediationAvailable === "undefined") {
|
if (input.isUserIdentified || typeof PublicKeyCredential.isConditionalMediationAvailable === "undefined") {
|
||||||
|
@ -17,7 +17,7 @@ export function initAuthenticate(input) {
|
||||||
function doAuthenticate(input) {
|
function doAuthenticate(input) {
|
||||||
// Check if WebAuthn is supported by this browser
|
// Check if WebAuthn is supported by this browser
|
||||||
if (!window.PublicKeyCredential) {
|
if (!window.PublicKeyCredential) {
|
||||||
returnFailure(input.errmsg);
|
// Fail silently as WebAuthn Conditional UI is not required
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,8 +50,8 @@ async function tryAutoFillUI(input) {
|
||||||
try {
|
try {
|
||||||
const result = await doAuthenticate(input);
|
const result = await doAuthenticate(input);
|
||||||
returnSuccess(result);
|
returnSuccess(result);
|
||||||
} catch (error) {
|
} catch {
|
||||||
returnFailure(error);
|
// Fail silently as WebAuthn Conditional UI is not required
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
document.getElementById("kc-form-passkey-button").style.display = 'block';
|
document.getElementById("kc-form-passkey-button").style.display = 'block';
|
||||||
|
|
Loading…
Reference in a new issue