mirror of
https://github.com/shuaiplus/nodewarden.git
synced 2026-06-20 13:00:39 +00:00
feat: improve handling of archived timestamps in cipher storage normalization
This commit is contained in:
@@ -47,7 +47,10 @@ function syncCipherComputedAliases(cipher: Cipher): Cipher {
|
|||||||
function normalizeCipherForStorage(cipher: Cipher): Cipher {
|
function normalizeCipherForStorage(cipher: Cipher): Cipher {
|
||||||
cipher.login = normalizeCipherLoginForStorage(cipher.login);
|
cipher.login = normalizeCipherLoginForStorage(cipher.login);
|
||||||
cipher.sshKey = normalizeCipherSshKeyForCompatibility(cipher.sshKey);
|
cipher.sshKey = normalizeCipherSshKeyForCompatibility(cipher.sshKey);
|
||||||
cipher.archivedAt = normalizeCipherTimestamp(cipher.archivedAt ?? cipher.archivedDate) ?? null;
|
const hasArchivedAt = Object.prototype.hasOwnProperty.call(cipher as object, 'archivedAt');
|
||||||
|
cipher.archivedAt = hasArchivedAt
|
||||||
|
? normalizeCipherTimestamp(cipher.archivedAt) ?? null
|
||||||
|
: normalizeCipherTimestamp(cipher.archivedDate) ?? null;
|
||||||
return syncCipherComputedAliases(cipher);
|
return syncCipherComputedAliases(cipher);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user