encryption settings loading moved from tree to encryption module

This commit is contained in:
azivner
2017-11-04 19:57:40 -04:00
parent dfaa59b0a9
commit 9c88fc6060
4 changed files with 20 additions and 14 deletions

View File

@@ -12,6 +12,16 @@ const encryption = (function() {
let encryptedDataKey = null;
let encryptionSessionTimeout = null;
$.ajax({
url: baseApiUrl + 'settings/all',
type: 'GET',
error: () => error("Error getting encryption settings.")
}).then(settings => {
encryptionSalt = settings.password_derived_key_salt;
encryptionSessionTimeout = settings.encryption_session_timeout;
encryptedDataKey = settings.encrypted_data_key;
});
function setEncryptionSalt(encSalt) {
encryptionSalt = encSalt;
}
@@ -438,7 +448,6 @@ const encryption = (function() {
}
return {
setEncryptionSalt,
setEncryptedDataKey,
setEncryptionSessionTimeout,
ensureEncryptionIsAvailable,