mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
add validation for used OTP codes
This commit is contained in:
@@ -294,6 +294,10 @@ async function getValidatedCode(
|
|||||||
throw new OTPError("Code expired");
|
throw new OTPError("Code expired");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (otpData.used_at) {
|
||||||
|
throw new OTPError("Code already used");
|
||||||
|
}
|
||||||
|
|
||||||
return otpData;
|
return otpData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user