mirror of
https://github.com/nextcloud/passman.git
synced 2025-09-16 09:55:00 +08:00
fix loading credential edit page from a direct url (or page reload) instead of coming from the credential list
This commit is contained in:
parent
40897518c3
commit
5e85719c29
1 changed files with 9 additions and 3 deletions
|
@ -104,17 +104,23 @@
|
|||
var storedCredential = SettingsService.getSetting('edit_credential');
|
||||
|
||||
if (!storedCredential) {
|
||||
$scope.storedCredential = {}; // this line is required for reactive model binding to update the value from the async callback
|
||||
CredentialService.getCredential($routeParams.credential_id).then(function (result) {
|
||||
$scope.storedCredential = CredentialService.decryptCredential(angular.copy(result));
|
||||
$scope.storedCredential.password_repeat = angular.copy($scope.storedCredential.password);
|
||||
$scope.storedCredential.expire_time = $scope.storedCredential.expire_time * 1000;
|
||||
|
||||
//store password to check if it was changed if this credential has been compromised
|
||||
$scope.oldPassword = $scope.storedCredential.password;
|
||||
});
|
||||
} else {
|
||||
$scope.storedCredential = CredentialService.decryptCredential(angular.copy(storedCredential));
|
||||
$scope.storedCredential.password_repeat = angular.copy($scope.storedCredential.password);
|
||||
$scope.storedCredential.expire_time = $scope.storedCredential.expire_time * 1000;
|
||||
}
|
||||
|
||||
//store password to check if it was changed if this credential has been compromised
|
||||
$scope.oldPassword=$scope.storedCredential.password;
|
||||
//store password to check if it was changed if this credential has been compromised
|
||||
$scope.oldPassword = $scope.storedCredential.password;
|
||||
}
|
||||
|
||||
$scope.getTags = function ($query) {
|
||||
return TagService.searchTag($query);
|
||||
|
|
Loading…
Add table
Reference in a new issue