1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-22 03:03:43 +00:00

org 2fa setting for duo

This commit is contained in:
Kyle Spearrin
2018-07-18 17:10:26 -04:00
parent 5131ebb9c9
commit ee4d2400c9
23 changed files with 148 additions and 34 deletions

View File

@@ -18,6 +18,7 @@ import { TwoFactorBaseComponent } from './two-factor-base.component';
templateUrl: 'two-factor-duo.component.html',
})
export class TwoFactorDuoComponent extends TwoFactorBaseComponent {
type = TwoFactorProviderType.Duo;
ikey: string;
skey: string;
host: string;
@@ -26,8 +27,7 @@ export class TwoFactorDuoComponent extends TwoFactorBaseComponent {
constructor(apiService: ApiService, i18nService: I18nService,
analytics: Angulartics2, toasterService: ToasterService,
platformUtilsService: PlatformUtilsService) {
super(apiService, i18nService, analytics, toasterService, platformUtilsService,
TwoFactorProviderType.Duo);
super(apiService, i18nService, analytics, toasterService, platformUtilsService);
}
auth(authResponse: any) {
@@ -51,7 +51,11 @@ export class TwoFactorDuoComponent extends TwoFactorBaseComponent {
request.host = this.host;
return super.enable(async () => {
this.formPromise = this.apiService.putTwoFactorDuo(request);
if (this.organizationId != null) {
this.formPromise = this.apiService.putTwoFactorOrganizationDuo(this.organizationId, request);
} else {
this.formPromise = this.apiService.putTwoFactorDuo(request);
}
const response = await this.formPromise;
await this.processResponse(response);
});