diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2022-09-18 19:37:36 +0200 |
---|---|---|
committer | TheArcaneBrony <myrainbowdash949@gmail.com> | 2022-09-18 19:37:36 +0200 |
commit | 780258a41b849b8d2278879a4f607f6234617b51 (patch) | |
tree | c5cacc6a98d564406fee0edbeb1771f01e9dd2ed | |
parent | Validate reg token before bypassing captchas and disabled registrations (diff) | |
download | server-780258a41b849b8d2278879a4f607f6234617b51.tar.xz |
Courtesy: run prettier
-rw-r--r-- | src/api/routes/auth/register.ts | 4 | ||||
-rw-r--r-- | src/api/routes/channels/#channel_id/messages/index.ts | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/api/routes/auth/register.ts b/src/api/routes/auth/register.ts index bff35b2f..50f89522 100644 --- a/src/api/routes/auth/register.ts +++ b/src/api/routes/auth/register.ts @@ -184,7 +184,9 @@ router.post("/", route({ body: "RegisterSchema" }), async (req: Request, res: Re ) ); } else { - let retryAfterSec = Math.ceil((oldest!.created_at.getTime() - new Date(Date.now() - limits.absoluteRate.register.window).getTime())/1000); + let retryAfterSec = Math.ceil( + (oldest!.created_at.getTime() - new Date(Date.now() - limits.absoluteRate.register.window).getTime()) / 1000 + ); return res .status(429) .set("X-RateLimit-Limit", `${limits.absoluteRate.register.limit}`) diff --git a/src/api/routes/channels/#channel_id/messages/index.ts b/src/api/routes/channels/#channel_id/messages/index.ts index 65cd42f3..87c689ec 100644 --- a/src/api/routes/channels/#channel_id/messages/index.ts +++ b/src/api/routes/channels/#channel_id/messages/index.ts @@ -188,7 +188,9 @@ router.post( ) ); } else { - let retryAfterSec = Math.ceil((oldest!.timestamp.getTime() - new Date(Date.now() - limits.absoluteRate.sendMessage.window).getTime())/1000); + let retryAfterSec = Math.ceil( + (oldest!.timestamp.getTime() - new Date(Date.now() - limits.absoluteRate.sendMessage.window).getTime()) / 1000 + ); return res .status(429) .set("X-RateLimit-Limit", `${limits.absoluteRate.sendMessage.limit}`) |