mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 17:23:37 +00:00
* PM-15115 - Captcha being deprecated so remove from new UI refreshed login component + start putting deprecated comments on some things. * PM-15115 - Add Jira ticket to TODOs per best practice
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import { I18nService } from "../platform/abstractions/i18n.service";
|
|
|
|
import { IFrameComponent } from "./iframe-component";
|
|
|
|
// TODO: PM-15162 - captcha is deprecated as part of UI refresh work
|
|
export class CaptchaIFrame extends IFrameComponent {
|
|
constructor(
|
|
win: Window,
|
|
webVaultUrl: string,
|
|
private i18nService: I18nService,
|
|
successCallback: (message: string) => any,
|
|
errorCallback: (message: string) => any,
|
|
infoCallback: (message: string) => any,
|
|
) {
|
|
super(
|
|
win,
|
|
webVaultUrl,
|
|
"captcha-connector.html",
|
|
"hcaptcha_iframe",
|
|
successCallback,
|
|
errorCallback,
|
|
(message: string) => {
|
|
const parsedMessage = JSON.parse(message);
|
|
if (typeof parsedMessage !== "string") {
|
|
this.iframe.height = parsedMessage.height.toString();
|
|
this.iframe.width = parsedMessage.width.toString();
|
|
} else {
|
|
infoCallback(parsedMessage);
|
|
}
|
|
},
|
|
);
|
|
}
|
|
|
|
init(siteKey: string): void {
|
|
super.initComponent(
|
|
this.createParams({ siteKey: siteKey, locale: this.i18nService.translationLocale }, 1),
|
|
);
|
|
}
|
|
}
|