diff --git a/javascript/src/utilities/secrets.js b/javascript/src/utilities/secrets.js index 8da18979d13f3466b644d85b7c016041962332bc..8c11a401586678690b279e154c1164f1751d36e6 100644 --- a/javascript/src/utilities/secrets.js +++ b/javascript/src/utilities/secrets.js @@ -75,15 +75,23 @@ export const checkRecoveryKeyCombine = (recoveryKey, recoveryKeyShares) => { console.log({ beginIndex, endIndex }); checkKey = combineSecret(recoveryKeyShares.slice(beginIndex, endIndex)); if (checkKey !== recoveryKey) { - return encodeResponse("400", "", "First sanity check failed"); + return encodeResponse( + "400", + "", + "Sanity check with required number of shares failed" + ); } - checkKey = combineSecret(recoveryKeyShares.slice(0, 2)); + checkKey = combineSecret(recoveryKeyShares.slice(0, 1)); if (checkKey === recoveryKey) { - return encodeResponse("400", "", "Second sanity check failed"); + return encodeResponse( + "400", + "", + "Sanity check with less than required shares failed" + ); } checkKey = combineSecret(recoveryKeyShares); if (checkKey !== recoveryKey) { - return encodeResponse("400", "", "Third sanity check failed"); + return encodeResponse("400", "", "Sanity check with all shares failed"); } return encodeResponse("200", "", "Check passed");