From 35394228cc45274863ad4881bd11144d3ce1d833 Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Sun, 1 Feb 2026 16:13:13 -0700 Subject: [PATCH] This should be fine actually --- src/routes/account/change-password/post.ts | 7 ------ src/routes/account/change-username/post.ts | 7 ------ src/routes/account/forgot-password/post.ts | 20 ----------------- src/routes/account/forgot-username/post.ts | 21 ------------------ src/routes/account/login/post.ts | 11 ---------- src/routes/account/register/post.ts | 22 ------------------- src/routes/account/reset-password/post.ts | 10 --------- src/routes/berrydash/account/save/post.ts | 8 ------- .../berrydash/icon-marketplace/upload/post.ts | 11 ---------- src/routes/berrydash/profile/posts/post.ts | 8 ------- src/routes/berrydash/splash-text/post.ts | 11 ---------- 11 files changed, 136 deletions(-) diff --git a/src/routes/account/change-password/post.ts b/src/routes/account/change-password/post.ts index 3db0ced..ddb5a1a 100644 --- a/src/routes/account/change-password/post.ts +++ b/src/routes/account/change-password/post.ts @@ -38,13 +38,6 @@ export async function handler (context: Context) { const userId = authResult.id const body = context.body as Body - if (!body.newPassword) { - connection0.end() - return jsonResponse( - { success: false, message: 'No new password provided' }, - 400 - ) - } if ( !/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d!@#$%^&*()_\-+=]{8,}$/.test( diff --git a/src/routes/account/change-username/post.ts b/src/routes/account/change-username/post.ts index 6eeb216..885a517 100644 --- a/src/routes/account/change-username/post.ts +++ b/src/routes/account/change-username/post.ts @@ -37,13 +37,6 @@ export async function handler (context: Context) { const userId = authResult.id const body = context.body as Body - if (!body.newUsername) { - connection0.end() - return jsonResponse( - { success: false, message: 'No new username provided' }, - 400 - ) - } if (!/^[a-zA-Z0-9]{3,16}$/.test(body.newUsername)) { connection0.end() diff --git a/src/routes/account/forgot-password/post.ts b/src/routes/account/forgot-password/post.ts index 31b512c..8aa3ab4 100644 --- a/src/routes/account/forgot-password/post.ts +++ b/src/routes/account/forgot-password/post.ts @@ -28,26 +28,6 @@ export async function handler (context: Context) { const { connection: connection0, db: db0 } = dbInfo0 const body = context.body as Body - if (!body.email || !body.verifyCode) { - connection0.end() - return jsonResponse( - { - success: false, - message: 'Email and verifyCode must be in POST data' - }, - 400 - ) - } - if (body.verifyCode.length != 16) { - connection0.end() - return jsonResponse( - { - success: false, - message: 'Invalid verify code (codes can only be used once)' - }, - 400 - ) - } const ip = getClientIp(context) if (!ip) { connection0.end() diff --git a/src/routes/account/forgot-username/post.ts b/src/routes/account/forgot-username/post.ts index 92a7c76..b68b9bd 100644 --- a/src/routes/account/forgot-username/post.ts +++ b/src/routes/account/forgot-username/post.ts @@ -27,26 +27,6 @@ export async function handler (context: Context) { const { connection: connection0, db: db0 } = dbInfo0 const body = context.body as Body - if (!body.email || !body.verifyCode) { - connection0.end() - return jsonResponse( - { - success: false, - message: 'Email and verifyCode must be in POST data' - }, - 400 - ) - } - if (body.verifyCode.length != 16) { - connection0.end() - return jsonResponse( - { - success: false, - message: 'Invalid verify code (codes can only be used once)' - }, - 400 - ) - } const ip = getClientIp(context) if (!ip) { connection0.end() @@ -58,7 +38,6 @@ export async function handler (context: Context) { 400 ) } - const time = Math.floor(Date.now() / 1000) if (!(await verifyTurstileOrVerifyCode(body.token, body.verifyCode, ip, db0))) return jsonResponse( { diff --git a/src/routes/account/login/post.ts b/src/routes/account/login/post.ts index 9d369c3..ed581ed 100644 --- a/src/routes/account/login/post.ts +++ b/src/routes/account/login/post.ts @@ -21,17 +21,6 @@ export async function handler (context: Context) { const { connection: connection0, db: db0 } = dbInfo0 const body = context.body as Body - if (!body.username || !body.password) { - connection0.end() - return jsonResponse( - { - success: false, - message: 'Username and password must be in POST data', - data: null - }, - 400 - ) - } const user = await db0 .select({ diff --git a/src/routes/account/register/post.ts b/src/routes/account/register/post.ts index be5e6ea..3169677 100644 --- a/src/routes/account/register/post.ts +++ b/src/routes/account/register/post.ts @@ -31,28 +31,6 @@ export async function handler (context: Context) { const { connection: connection1, db: db1 } = dbInfo1 const body = context.body as Body - if (!body.username || !body.password || !body.email || !body.verifyCode) { - connection0.end() - connection1.end() - return jsonResponse( - { - success: false, - message: 'Username, password, email and verifyCode must be in POST data' - }, - 400 - ) - } - if (body.verifyCode.length != 16) { - connection0.end() - connection1.end() - return jsonResponse( - { - success: false, - message: 'Invalid verify code (codes can only be used once)' - }, - 400 - ) - } const ip = getClientIp(context) if (!ip) { connection0.end() diff --git a/src/routes/account/reset-password/post.ts b/src/routes/account/reset-password/post.ts index 21520d1..b692651 100644 --- a/src/routes/account/reset-password/post.ts +++ b/src/routes/account/reset-password/post.ts @@ -27,16 +27,6 @@ export async function handler (context: Context) { const { connection: connection0, db: db0 } = dbInfo0 const body = context.body as Body - if (!body.token || !body.code || !body.password) { - connection0.end() - return jsonResponse( - { - success: false, - message: 'Token, code and password must be in POST data' - }, - 400 - ) - } if (body.code.length != 64) { connection0.end() return jsonResponse( diff --git a/src/routes/berrydash/account/save/post.ts b/src/routes/berrydash/account/save/post.ts index 49c9c23..f7d3d3a 100644 --- a/src/routes/berrydash/account/save/post.ts +++ b/src/routes/berrydash/account/save/post.ts @@ -39,14 +39,6 @@ export async function handler (context: Context) { const userId = authResult.id const body = context.body as Body - if (!body.saveData) { - connection0.end() - connection1.end() - return jsonResponse( - { success: false, message: 'No valid save data provided' }, - 400 - ) - } let userSaveData: any = {} try { diff --git a/src/routes/berrydash/icon-marketplace/upload/post.ts b/src/routes/berrydash/icon-marketplace/upload/post.ts index 3298d21..b65e45b 100644 --- a/src/routes/berrydash/icon-marketplace/upload/post.ts +++ b/src/routes/berrydash/icon-marketplace/upload/post.ts @@ -73,17 +73,6 @@ export async function handler (context: Context) { const userId = authResult.id const body = context.body as Body - if (!body.verifyCode && !body.token) { - connection0.end() - connection1.end() - return jsonResponse( - { - success: false, - message: 'verifyCode or token must be provided in POST data' - }, - 400 - ) - } const price = parseInt(body.price, 10) if (isNaN(price)) { connection0.end() diff --git a/src/routes/berrydash/profile/posts/post.ts b/src/routes/berrydash/profile/posts/post.ts index ba8263c..2f37711 100644 --- a/src/routes/berrydash/profile/posts/post.ts +++ b/src/routes/berrydash/profile/posts/post.ts @@ -41,14 +41,6 @@ export async function handler (context: Context) { const userId = authResult.id const body = context.body as Body - if (!body.content) { - connection0.end() - connection1.end() - return jsonResponse( - { success: false, message: 'No valid content provided', data: null }, - 400 - ) - } await db1 .insert(berryDashUserPosts) diff --git a/src/routes/berrydash/splash-text/post.ts b/src/routes/berrydash/splash-text/post.ts index 53806ae..1f8029a 100644 --- a/src/routes/berrydash/splash-text/post.ts +++ b/src/routes/berrydash/splash-text/post.ts @@ -53,17 +53,6 @@ export async function handler (context: Context) { const userId = authResult.id const body = context.body as Body - if (!body.token || !body.content) { - connection0.end() - connection1.end() - return jsonResponse( - { - success: false, - message: 'Token and content must be in POST data' - }, - 400 - ) - } if (body.content.length > 72) { connection0.end() connection1.end()