mirror of
https://github.com/bitwarden/browser.git
synced 2024-10-21 07:46:38 +02:00
29 lines
967 B
JavaScript
29 lines
967 B
JavaScript
|
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);
|
|||
|
});
|
|||
|
});
|
|||
|
}
|
|||
|
});
|