1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 16:53:34 +00:00

password hint

This commit is contained in:
Kyle Spearrin
2016-09-20 17:47:21 -04:00
parent 797a18b46a
commit 0219068bb6
14 changed files with 115 additions and 22 deletions

View File

@@ -0,0 +1,28 @@
angular
.module('bit.accounts')
.controller('accountsHintController', function ($scope, $state, apiService, toastr, $q) {
popupUtils.initListSectionItemListeners();
$scope.submitPromise = null;
$scope.submit = function (model) {
var request = new PasswordHintRequest(model.email);
$scope.submitPromise = hintPromise(request);
$scope.submitPromise.then(function () {
toastr.success('We\'ve sent you an email with your master password hint.');
$state.go('login');
});
};
function hintPromise(request) {
return $q(function (resolve, reject) {
apiService.postPasswordHint(request,
function () {
resolve();
},
function (error) {
reject(error);
});
});
}
});