diff --git a/libraries/access-token-encryptor/scripts/helpers/re-encrypt-tokens.js b/libraries/access-token-encryptor/scripts/helpers/re-encrypt-tokens.js index 2d75620ce9..abf4d53c12 100644 --- a/libraries/access-token-encryptor/scripts/helpers/re-encrypt-tokens.js +++ b/libraries/access-token-encryptor/scripts/helpers/re-encrypt-tokens.js @@ -70,7 +70,8 @@ async function reEncryptTokensInCollection({ if (!blob) continue // Schema: LABEL-VERSION:SALT:CIPHERTEXT:IV const [label] = blob.split(':') - const [, version] = label.split('-') + let [, version] = label.split('-') + version = version || 'v2' const key = [name, version, collectionName, path, label].join(':') stats[key] = (stats[key] || 0) + 1 diff --git a/services/web/scripts/count_encrypted_access_tokens.js b/services/web/scripts/count_encrypted_access_tokens.js index d53bbe9824..f41bdf38a1 100644 --- a/services/web/scripts/count_encrypted_access_tokens.js +++ b/services/web/scripts/count_encrypted_access_tokens.js @@ -42,7 +42,8 @@ async function count(collectionName, paths) { if (!blob) continue // Schema: LABEL-VERSION:SALT:CIPHERTEXT:IV const [label] = blob.split(':') - const [, version] = label.split('-') + let [, version] = label.split('-') + version = version || 'v2' const key = [name, version, collectionName, path, label].join(':') stats[key] = (stats[key] || 0) + 1