fix(routes/OTP): timeout condition check
- The condition was inverted for the expiration of the token will be unvalidated
This commit is contained in:
parent
61adf0f742
commit
29a5d38530
1 changed files with 1 additions and 1 deletions
|
|
@ -35,7 +35,7 @@ const route: FastifyPluginAsync = async (fastify, opts): Promise<void> => {
|
|||
// no ? fuck off then
|
||||
return makeResponse("failed", "otp.failed.invalid");
|
||||
// is it too old ?
|
||||
if (dJwt.createdAt + OTP_TOKEN_TIMEOUT_SEC * 1000 > Date.now())
|
||||
if (dJwt.createdAt + OTP_TOKEN_TIMEOUT_SEC * 1000 < Date.now())
|
||||
// yes ? fuck off then, redo the password
|
||||
return makeResponse("failed", "otp.failed.timeout");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue