1
0
mirror of https://github.com/bitwarden/web synced 2025-12-17 00:33:26 +00:00

convert auth service profile methods to promises

This commit is contained in:
Kyle Spearrin
2017-03-25 10:43:19 -04:00
parent 2154607d11
commit 19203e976b
8 changed files with 162 additions and 145 deletions

View File

@@ -4,13 +4,16 @@
.controller('settingsTwoFactorController', function ($scope, apiService, $uibModalInstance, cryptoService, authService, $q, toastr, $analytics) {
$analytics.eventTrack('settingsTwoFactorController', { category: 'Modal' });
var _issuer = 'bitwarden',
_profile = authService.getUserProfile(),
_profile = null,
_masterPasswordHash;
$scope.account = _profile.email;
$scope.enabled = function () {
return _profile.extended && _profile.extended.twoFactorEnabled;
};
authService.getUserProfile().then(function (profile) {
_profile = profile;
$scope.account = _profile.email;
$scope.enabled = function () {
return _profile.extended && _profile.extended.twoFactorEnabled;
};
});
$scope.auth = function (model) {
_masterPasswordHash = cryptoService.hashPassword(model.masterPassword);