Update vault keys on password change

This commit is contained in:
brantje 2016-10-07 18:22:55 +02:00
parent 2b6e9c331c
commit ac086845b2
No known key found for this signature in database
GPG key ID: 5FF1D117F918687F
3 changed files with 10 additions and 2 deletions

View file

@ -195,6 +195,7 @@ angular.module('passmanApp')
vault.private_sharing_key = EncryptService.encryptString(vault.private_sharing_key, newVaultPass); vault.private_sharing_key = EncryptService.encryptString(vault.private_sharing_key, newVaultPass);
VaultService.updateSharingKeys(vault).then(function (result) { VaultService.updateSharingKeys(vault).then(function (result) {
$rootScope.$broadcast('logout') $rootScope.$broadcast('logout')
NotificationService.showNotification('Please login with your new vault password', 5000);
}); });
} }
}); });
@ -204,6 +205,13 @@ angular.module('passmanApp')
}) })
}; };
$rootScope.$on('logout', function () {
$scope.active_vault = null;
VaultService.setActiveVault(null);
$location.path('/');
});
$scope.cancel = function () { $scope.cancel = function () {
$location.path('/vault/' + $routeParams.vault_id); $location.path('/vault/' + $routeParams.vault_id);
}; };

View file

@ -51,7 +51,7 @@ angular.module('views/partials/forms/settings/export.html', []).run(['$templateC
angular.module('views/partials/forms/settings/general_settings.html', []).run(['$templateCache', function($templateCache) { angular.module('views/partials/forms/settings/general_settings.html', []).run(['$templateCache', function($templateCache) {
'use strict'; 'use strict';
$templateCache.put('views/partials/forms/settings/general_settings.html', $templateCache.put('views/partials/forms/settings/general_settings.html',
'<div class="row"><div class="col-xs-12 col-md-6"><h3>Rename vault</h3><label>New vault name</label><input type="text" ng-model="$parent.new_vault_name"> <button ng-click="saveVaultSettings()">Change</button><h3>Change vault key</h3><label>Old vault password</label><input type="password" ng-model="oldVaultPass"><label>New vault password</label><password-gen ng-model="newVaultPass"></password-gen><ng-password-meter password="newVaultPass"></ng-password-meter><label>New vault password</label><input type="password" ng-model="newVaultPass2"><div ng-show="error" class="error"><ul><li>{{error}}</li></ul></div><button ng-click="changeVaultPassword(oldVaultPass,newVaultPass,newVaultPass2)">Change</button><div ng-show="change_pw.total > 0">Please wait you vault is being updated, do not leave this page.<br>Processing {{cur_state.process}}<div progress-bar="cur_state.calculated" index="cur_state.current" total="cur_state.total"></div>Total progress<div progress-bar="change_pw.percent" index="change_pw.done" total="change_pw.total"></div></div></div><div class="col-xs-12 col-md-6"><h3>About passman</h3><p>Version: <b>{{passman_version}}</b><br>Bla bla about passman, changelog.<br><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6YS8F97PETVU2" target="_blank" class="link">Donate to support development</a><br></p><h3>Bookmarklet</h3><div><p>Save your passwords with 1 click!<br>Drag below button to your bookmark toolbar.<br></p></div><div><p ng-bind-html="bookmarklet" style="margin-top: 5px"></p></div></div></div>'); '<div class="row"><div class="col-xs-12 col-md-6"><h3>Rename vault</h3><label>New vault name</label><input type="text" ng-model="$parent.new_vault_name"> <button ng-click="saveVaultSettings()">Change</button><h3>Change vault key</h3><label>Old vault password</label><input type="password" ng-model="oldVaultPass"><label>New vault password</label><password-gen ng-model="newVaultPass"></password-gen><ng-password-meter password="newVaultPass"></ng-password-meter><label>New vault password</label><input type="password" ng-model="newVaultPass2"><div ng-show="error" class="error"><ul><li>{{error}}</li></ul></div><button ng-click="changeVaultPassword(oldVaultPass,newVaultPass,newVaultPass2)">Change</button><div ng-show="change_pw.total > 0">Please wait your vault is being updated, do not leave this page.<br>Processing {{cur_state.process}}<div progress-bar="cur_state.calculated" index="cur_state.current" total="cur_state.total"></div>Total progress<div progress-bar="change_pw.percent" index="change_pw.done" total="change_pw.total"></div></div></div><div class="col-xs-12 col-md-6"><h3>About passman</h3><p>Version: <b>{{passman_version}}</b><br>Bla bla about passman, changelog.<br><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6YS8F97PETVU2" target="_blank" class="link">Donate to support development</a><br></p><h3>Bookmarklet</h3><div><p>Save your passwords with 1 click!<br>Drag below button to your bookmark toolbar.<br></p></div><div><p ng-bind-html="bookmarklet" style="margin-top: 5px"></p></div></div></div>');
}]); }]);
angular.module('views/partials/forms/settings/import.html', []).run(['$templateCache', function($templateCache) { angular.module('views/partials/forms/settings/import.html', []).run(['$templateCache', function($templateCache) {

View file

@ -26,7 +26,7 @@
>Change >Change
</button> </button>
<div ng-show="change_pw.total > 0"> <div ng-show="change_pw.total > 0">
Please wait you vault is being updated, do not leave this page.<br /> Please wait your vault is being updated, do not leave this page.<br />
Processing {{cur_state.process}} Processing {{cur_state.process}}
<div progress-bar="cur_state.calculated" index="cur_state.current" total="cur_state.total"></div> <div progress-bar="cur_state.calculated" index="cur_state.current" total="cur_state.total"></div>
Total progress Total progress