feat: integration user lock flow to frontend

This commit is contained in:
Sheen Capadngan
2024-05-22 22:51:20 +08:00
parent 41d72d5dc6
commit e3dae9d498
5 changed files with 34 additions and 25 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ export const processFailedMfaAttempt = async (userId: string, userDAL: Pick<TUse
const progressiveDelaysInMins = [5, 30, 60];
// lock user when failed attempt exceeds threshold
if (user.consecutiveFailedMfaAttempts > PROGRESSIVE_DELAY_INTERVAL * progressiveDelaysInMins.length) {
if (user.consecutiveFailedMfaAttempts >= PROGRESSIVE_DELAY_INTERVAL * (progressiveDelaysInMins.length + 1)) {
return (
await tx(TableName.Users)
.where("id", userId)