1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-06-26 10:35:48 +02: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

@ -912,6 +912,9 @@
"popup2faCloseMessage": {
"message": "Clicking outside the popup window to check your email for your verification code will cause this popup to close. Do you want to open this popup in a new window so that it does not close?"
},
"popupU2fCloseMessage": {
"message": "This browser cannot process U2F requests in this popup window. Do you want to open this popup in a new window so that you can log in using U2F?"
},
"disableFavicon": {
"message": "Disable Website Icons"
},

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) {