diff --git a/src/angular/components/two-factor-options.component.ts b/src/angular/components/two-factor-options.component.ts index cad2734cf6..e28fdef321 100644 --- a/src/angular/components/two-factor-options.component.ts +++ b/src/angular/components/two-factor-options.component.ts @@ -25,7 +25,8 @@ export class TwoFactorOptionsComponent implements OnInit { constructor(protected authService: AuthService, protected router: Router, protected analytics: Angulartics2, protected toasterService: ToasterService, - protected i18nService: I18nService, protected platformUtilsService: PlatformUtilsService) { } + protected i18nService: I18nService, protected platformUtilsService: PlatformUtilsService, + protected win: Window) { } ngOnInit() { if (this.authService.twoFactorProviders.has(TwoFactorProviderType.OrganizationDuo)) { @@ -45,7 +46,7 @@ export class TwoFactorOptionsComponent implements OnInit { } if (this.authService.twoFactorProviders.has(TwoFactorProviderType.U2f) && - this.platformUtilsService.supportsU2f(window)) { + this.platformUtilsService.supportsU2f(this.win)) { this.providers.push(TwoFactorProviders[TwoFactorProviderType.U2f]); } diff --git a/src/angular/components/two-factor.component.ts b/src/angular/components/two-factor.component.ts index 799bd5b4b7..226d2b2676 100644 --- a/src/angular/components/two-factor.component.ts +++ b/src/angular/components/two-factor.component.ts @@ -46,7 +46,7 @@ export class TwoFactorComponent implements OnInit, OnDestroy { protected i18nService: I18nService, protected apiService: ApiService, protected platformUtilsService: PlatformUtilsService, protected syncService: SyncService, protected win: Window, protected environmentService: EnvironmentService) { - this.u2fSupported = this.platformUtilsService.supportsU2f(window); + this.u2fSupported = this.platformUtilsService.supportsU2f(win); } async ngOnInit() { @@ -119,7 +119,7 @@ export class TwoFactorComponent implements OnInit, OnDestroy { } setTimeout(() => { - (window as any).Duo.init({ + (this.win as any).Duo.init({ host: params.Host, sig_request: params.Signature, submit_callback: async (f: HTMLFormElement) => { diff --git a/src/angular/components/view.component.ts b/src/angular/components/view.component.ts index dc3a1e8d19..da63d5c69f 100644 --- a/src/angular/components/view.component.ts +++ b/src/angular/components/view.component.ts @@ -46,7 +46,7 @@ export class ViewComponent implements OnDestroy { protected tokenService: TokenService, protected toasterService: ToasterService, protected cryptoService: CryptoService, protected platformUtilsService: PlatformUtilsService, protected i18nService: I18nService, protected analytics: Angulartics2, - protected auditService: AuditService) { } + protected auditService: AuditService, protected win: Window) { } ngOnDestroy() { this.cleanUp(); @@ -145,7 +145,7 @@ export class ViewComponent implements OnDestroy { const buf = await response.arrayBuffer(); const key = await this.cryptoService.getOrgKey(this.cipher.organizationId); const decBuf = await this.cryptoService.decryptFromBytes(buf, key); - this.platformUtilsService.saveFile(window, decBuf, null, attachment.fileName); + this.platformUtilsService.saveFile(this.win, decBuf, null, attachment.fileName); } catch (e) { this.toasterService.popAsync('error', null, this.i18nService.t('errorOccurred')); }