mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 16:53:34 +00:00
password hint
This commit is contained in:
28
src/popup/app/accounts/accountsHintController.js
Normal file
28
src/popup/app/accounts/accountsHintController.js
Normal 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);
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user