1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-24 12:06:15 +01:00

supports duo platform util

This commit is contained in:
Kyle Spearrin 2018-05-16 15:30:28 -04:00
parent e6fde2e92b
commit cf5bce1ea9
3 changed files with 8 additions and 2 deletions

View File

@ -18,6 +18,7 @@ export abstract class PlatformUtilsService {
saveFile: (win: Window, blobData: any, blobOptions: any, fileName: string) => void;
getApplicationVersion: () => string;
supportsU2f: (win: Window) => boolean;
supportsDuo: () => boolean;
showDialog: (text: string, title?: string, confirmText?: string, cancelText?: string,
type?: string) => Promise<boolean>;
isDev: () => boolean;

View File

@ -123,6 +123,10 @@ export class ElectronPlatformUtilsService implements PlatformUtilsService {
return false;
}
supportsDuo(): boolean {
return true;
}
showDialog(text: string, title?: string, confirmText?: string, cancelText?: string, type?: string):
Promise<boolean> {
const buttons = [confirmText == null ? this.i18nService.t('ok') : confirmText];

View File

@ -127,7 +127,8 @@ export class AuthService {
return providers;
}
if (this.twoFactorProviders.has(TwoFactorProviderType.OrganizationDuo)) {
if (this.twoFactorProviders.has(TwoFactorProviderType.OrganizationDuo) &&
this.platformUtilsService.supportsDuo()) {
providers.push(TwoFactorProviders[TwoFactorProviderType.OrganizationDuo]);
}
@ -139,7 +140,7 @@ export class AuthService {
providers.push(TwoFactorProviders[TwoFactorProviderType.Yubikey]);
}
if (this.twoFactorProviders.has(TwoFactorProviderType.Duo)) {
if (this.twoFactorProviders.has(TwoFactorProviderType.Duo) && this.platformUtilsService.supportsDuo()) {
providers.push(TwoFactorProviders[TwoFactorProviderType.Duo]);
}