From 5343c14184a274379d835b5657bb9f7d8ee843ae Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Wed, 28 Jun 2023 23:04:40 -0700 Subject: [PATCH] fix: :bug: don't convert time since epoch for ratelimit https://calckey.social/notes/9gkasnzglmi07rpa --- packages/backend/src/server/api/limiter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/limiter.ts b/packages/backend/src/server/api/limiter.ts index a661ed0e95..367fb3d279 100644 --- a/packages/backend/src/server/api/limiter.ts +++ b/packages/backend/src/server/api/limiter.ts @@ -79,7 +79,7 @@ export const limiter = ( if (info.remaining === 0) { reject({ message: "RATE_LIMIT_EXCEEDED", - remainingTime: convertMilliseconds(info.resetMs), + remainingTime: convertMilliseconds(info.resetMs - Date.now()), }); } else { ok();