web/flows: fix invisible captcha call (cherry-pick #12048) (#12049)

web/flows: fix invisible captcha call (#12048)

* fix invisible captcha call

* fix invisible captcha DOM removal

Co-authored-by: Simonyi Gergő <28359278+gergosimonyi@users.noreply.github.com>
This commit is contained in:
gcp-cherry-pick-bot[bot]
2024-11-15 18:50:57 +01:00
committed by GitHub
parent 7e8891338f
commit b51d8d0ba3

View File

@ -85,7 +85,7 @@ export class CaptchaStage extends BaseStage<CaptchaChallenge, CaptchaChallengeRe
super.disconnectedCallback();
window.removeEventListener("message", this.messageCallback);
if (!this.challenge.interactive) {
document.removeChild(this.captchaDocumentContainer);
document.body.removeChild(this.captchaDocumentContainer);
}
}
@ -173,7 +173,7 @@ export class CaptchaStage extends BaseStage<CaptchaChallenge, CaptchaChallengeRe
.forEach((el) => el.remove());
document.head.appendChild(this.scriptElement);
if (!this.challenge.interactive) {
document.appendChild(this.captchaDocumentContainer);
document.body.appendChild(this.captchaDocumentContainer);
}
}
}