From 92fab815bed15eae56f66c761b913fcd9178b0e6 Mon Sep 17 00:00:00 2001 From: Matt H Date: Mon, 6 May 2024 16:03:56 -0400 Subject: [PATCH] If the API Secret is NOT valid, log its first and last few characters This should help us confirm whether, for instance, and equals sign has been dropped from the end of the string. --- models/api-key.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/models/api-key.js b/models/api-key.js index d544bab..8d3e3a7 100644 --- a/models/api-key.js +++ b/models/api-key.js @@ -182,6 +182,8 @@ const isValidApiSecret = (apiKeyRecord, apiSecret = '') => { const isValid = password.compare(apiSecret, apiKeyRecord.hashedApiSecret); if (isValid !== true) { console.log('The given API Secret is NOT valid for the given API Key record.'); + const redactedApiSecret = apiSecret.substring(0, 3) + '...[snip]...' + apiSecret.substring(apiSecret.length - 3); + console.log(redactedApiSecret); return false; }