From 7e1450f581ffae24836e99a64af2acb383942792 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 3 Apr 2018 15:27:36 -0400 Subject: [PATCH] add support for organization duo 2fa --- jslib | 2 +- src/_locales/en/messages.json | 8 ++++++++ .../app/accounts/accountsLoginTwoFactorController.js | 5 ++--- .../app/accounts/accountsTwoFactorMethodsController.js | 3 +++ src/popup/app/accounts/views/accountsLoginTwoFactor.html | 8 ++++++-- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/jslib b/jslib index bdbb01317d..167558168c 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit bdbb01317d6b41a9c0f74d47bf89e8ed11631fdc +Subproject commit 167558168c4ddff8eff67d7f12dfac47d5d25866 diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index b8b8c58f82..d835cfb763 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -720,6 +720,10 @@ "message": "Verify with Duo Security using the Duo Mobile app, SMS, phone call, or U2F security key.", "description": "'Duo Security' and 'Duo Mobile' are product names and should not be translated." }, + "duoOrganizationDesc": { + "message": "Verify with Duo Security for your organization using the Duo Mobile app, SMS, phone call, or U2F security key.", + "description": "'Duo Security' and 'Duo Mobile' are product names and should not be translated." + }, "u2fDesc": { "message": "Use any FIDO U2F enabled security key to access your account." }, @@ -1026,5 +1030,9 @@ }, "toggleOptions": { "message": "Toggle Options" + }, + "organization": { + "message": "Organization", + "description": "An entity of multiple related people (ex. a team or business organization)." } } diff --git a/src/popup/app/accounts/accountsLoginTwoFactorController.js b/src/popup/app/accounts/accountsLoginTwoFactorController.js index 990017c211..286f505b18 100644 --- a/src/popup/app/accounts/accountsLoginTwoFactorController.js +++ b/src/popup/app/accounts/accountsLoginTwoFactorController.js @@ -127,8 +127,6 @@ angular }); $scope.$on('2faPageResponse', (event, details) => { - console.log('got 2fa response'); - console.log(details); if (details.type === 'duo') { $scope.login(details.data.sigValue, details.tab); } @@ -145,7 +143,8 @@ angular } var params = providers.get($scope.providerType); - if ($scope.providerType === constants.twoFactorProvider.duo) { + if ($scope.providerType === constants.twoFactorProvider.duo || + $scope.providerType === constants.twoFactorProvider.organizationDuo) { if (platformUtilsService.isSafari()) { var tab = BrowserApi.createNewTab(BrowserApi.getAssetUrl('2fa/index.html')); var tabToSend = BrowserApi.makeTabObject(tab); diff --git a/src/popup/app/accounts/accountsTwoFactorMethodsController.js b/src/popup/app/accounts/accountsTwoFactorMethodsController.js index 8a77dfe346..3d0d199a01 100644 --- a/src/popup/app/accounts/accountsTwoFactorMethodsController.js +++ b/src/popup/app/accounts/accountsTwoFactorMethodsController.js @@ -11,6 +11,9 @@ angular $scope.providers = []; + if (providers.get(constants.twoFactorProvider.organizationDuo)) { + add(constants.twoFactorProvider.organizationDuo); + } if (providers.get(constants.twoFactorProvider.authenticator)) { add(constants.twoFactorProvider.authenticator); } diff --git a/src/popup/app/accounts/views/accountsLoginTwoFactor.html b/src/popup/app/accounts/views/accountsLoginTwoFactor.html index 318ea3a699..f463dd8b73 100644 --- a/src/popup/app/accounts/views/accountsLoginTwoFactor.html +++ b/src/popup/app/accounts/views/accountsLoginTwoFactor.html @@ -44,12 +44,16 @@ -
+
-
Duo
+
+ Duo + ({{i18n.organization}}) +