mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 09:13:33 +00:00
stubbed out new two-step settings page
This commit is contained in:
56
src/app/settings/settingsTwoStepController.js
Normal file
56
src/app/settings/settingsTwoStepController.js
Normal file
@@ -0,0 +1,56 @@
|
||||
angular
|
||||
.module('bit.settings')
|
||||
|
||||
.controller('settingsTwoStepController', function ($scope, apiService, authService, toastr, $analytics, constants,
|
||||
$filter) {
|
||||
$scope.providers = [
|
||||
{
|
||||
type: constants.twoFactorProvider.authenticator,
|
||||
name: 'Authenticator App',
|
||||
description: 'Use auth app.',
|
||||
enabled: false,
|
||||
free: true
|
||||
},
|
||||
{
|
||||
type: constants.twoFactorProvider.yubikey,
|
||||
name: 'YubiKey OTP',
|
||||
description: '',
|
||||
enabled: false
|
||||
},
|
||||
{
|
||||
type: constants.twoFactorProvider.duo,
|
||||
name: 'Duo',
|
||||
description: '',
|
||||
enabled: false
|
||||
},
|
||||
{
|
||||
type: constants.twoFactorProvider.u2f,
|
||||
name: 'FIDO U2F Security Key',
|
||||
description: '',
|
||||
enabled: false
|
||||
},
|
||||
{
|
||||
type: constants.twoFactorProvider.email,
|
||||
name: 'Email',
|
||||
description: '',
|
||||
enabled: false
|
||||
}
|
||||
];
|
||||
|
||||
apiService.twoFactor.list({}, function (response) {
|
||||
for (var i = 0; i < response.Data.length; i++) {
|
||||
if (!response.Data[i].Enabled) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var provider = $filter('filter')($scope.providers, { type: response.Data[i].Type });
|
||||
if (provider.length) {
|
||||
provider[0].enabled = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
authService.getUserProfile().then(function (profile) {
|
||||
_profile = profile;
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user