This should be fine actually

This commit is contained in:
2026-02-01 16:13:13 -07:00
parent b4309294e6
commit 35394228cc
11 changed files with 0 additions and 136 deletions

View File

@@ -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(

View File

@@ -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()

View File

@@ -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()

View File

@@ -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(
{

View File

@@ -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({

View File

@@ -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()

View File

@@ -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(

View File

@@ -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 {

View File

@@ -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()

View File

@@ -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)

View File

@@ -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()