1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 15:53:27 +00:00

workaround for u2f bug in firefox on w10

This commit is contained in:
Kyle Spearrin
2019-07-03 10:37:13 -04:00
parent 2a6175060c
commit 6c110bb9a4
2 changed files with 19 additions and 0 deletions

View File

@@ -66,8 +66,15 @@ export class TwoFactorComponent extends BaseTwoFactorComponent {
});
});
const isFirefox = this.platformUtilsService.isFirefox();
if (this.popupUtilsService.inPopup(window) && isFirefox &&
this.win.navigator.userAgent.indexOf('Windows NT 10.0;') > -1) {
// ref: https://bugzilla.mozilla.org/show_bug.cgi?id=1562620
this.initU2f = false;
}
const isSafari = this.platformUtilsService.isSafari();
this.showNewWindowMessage = isSafari;
await super.ngOnInit();
if (this.selectedProviderType == null) {
@@ -83,6 +90,15 @@ export class TwoFactorComponent extends BaseTwoFactorComponent {
}
}
if (!this.initU2f && this.selectedProviderType === TwoFactorProviderType.U2f &&
this.popupUtilsService.inPopup(window)) {
const confirmed = await this.platformUtilsService.showDialog(this.i18nService.t('popupU2fCloseMessage'),
null, this.i18nService.t('yes'), this.i18nService.t('no'));
if (confirmed) {
this.popupUtilsService.popOut(window);
}
}
const isDuo = this.selectedProviderType === TwoFactorProviderType.Duo ||
this.selectedProviderType === TwoFactorProviderType.OrganizationDuo;
if (!isSafari || !isDuo) {