Skip to content
Snippets Groups Projects
Commit 6a05e6d6 authored by Sasha Ilieva's avatar Sasha Ilieva
Browse files

Fix response messages

parent 165c12ad
No related branches found
No related tags found
1 merge request!88908 account recovery ability to add contacts to trusted contacts list for account recovery
......@@ -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");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment