From 744880bb3842427c578fb6858e78f2524b4c3faf 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 a661ed0e9..367fb3d27 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();