Merge commit from fork
This commit is contained in:
parent
092b1b45f8
commit
e287fab560
@ -38,7 +38,7 @@ async function recoverAccount(username = "", recoveryCodes = []) {
|
|||||||
// because this is a user who has not logged out and back in since upgrade.
|
// because this is a user who has not logged out and back in since upgrade.
|
||||||
const allUserHashes = await RecoveryCode.hashesForUser(user.id);
|
const allUserHashes = await RecoveryCode.hashesForUser(user.id);
|
||||||
if (allUserHashes.length < 4)
|
if (allUserHashes.length < 4)
|
||||||
return { success: false, error: "Invalid recovery codes" };
|
return { success: false, error: "Invalid recovery codes." };
|
||||||
|
|
||||||
// If they tried to send more than two unique codes, we only take the first two
|
// If they tried to send more than two unique codes, we only take the first two
|
||||||
const uniqueRecoveryCodes = [...new Set(recoveryCodes)]
|
const uniqueRecoveryCodes = [...new Set(recoveryCodes)]
|
||||||
@ -55,7 +55,7 @@ async function recoverAccount(username = "", recoveryCodes = []) {
|
|||||||
});
|
});
|
||||||
return valid;
|
return valid;
|
||||||
});
|
});
|
||||||
if (!validCodes) return { success: false, error: "Invalid recovery codes" };
|
if (!validCodes) return { success: false, error: "Invalid recovery codes." };
|
||||||
|
|
||||||
const { passwordResetToken, error } = await PasswordResetToken.create(
|
const { passwordResetToken, error } = await PasswordResetToken.create(
|
||||||
user.id
|
user.id
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user