mirror of
https://github.com/nextcloud/passman.git
synced 2025-01-30 11:20:16 +08:00
Force logout if localstorage password is wrong *rework*
This commit is contained in:
parent
79052e4d70
commit
67b8dbe511
1 changed files with 11 additions and 20 deletions
|
@ -70,9 +70,7 @@ angular.module('passmanApp')
|
||||||
$scope.sharing_keys = {};
|
$scope.sharing_keys = {};
|
||||||
$scope.newVault = function () {
|
$scope.newVault = function () {
|
||||||
$scope.creating_vault = true;
|
$scope.creating_vault = true;
|
||||||
var _vault = {
|
var _vault = {};
|
||||||
|
|
||||||
};
|
|
||||||
var key_size = 1024;
|
var key_size = 1024;
|
||||||
ShareService.generateRSAKeys(key_size).progress(function (progress) {
|
ShareService.generateRSAKeys(key_size).progress(function (progress) {
|
||||||
var p = progress > 0 ? 2 : 1;
|
var p = progress > 0 ? 2 : 1;
|
||||||
|
@ -102,24 +100,17 @@ angular.module('passmanApp')
|
||||||
_vault.vaultKey = angular.copy(vault_key);
|
_vault.vaultKey = angular.copy(vault_key);
|
||||||
VaultService.setActiveVault(_vault);
|
VaultService.setActiveVault(_vault);
|
||||||
VaultService.getVault(vault).then(function (credentials) {
|
VaultService.getVault(vault).then(function (credentials) {
|
||||||
for (var i = 0; i < credentials.length; i++) {
|
var credential = credentials[0];
|
||||||
var credential = credentials[i];
|
|
||||||
if (credential.hidden = true) {
|
|
||||||
try {
|
try {
|
||||||
var c = CredentialService.decryptCredential(credential);
|
var c = CredentialService.decryptCredential(credential);
|
||||||
if (c.password === 'lorum ipsum') {
|
|
||||||
if ($scope.remember_vault_password) {
|
if ($scope.remember_vault_password) {
|
||||||
SettingsService.setSetting('defaultVaultPass', vault_key);
|
SettingsService.setSetting('defaultVaultPass', vault_key);
|
||||||
}
|
}
|
||||||
_loginToVault(vault, vault_key);
|
_loginToVault(vault, vault_key);
|
||||||
}
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
|
||||||
$scope.error = 'Incorrect vault password!'
|
$scope.error = 'Incorrect vault password!'
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue