fix crashes

This commit is contained in:
split / May 2024-04-28 01:20:48 -07:00
parent d5cf1470cf
commit 1da5f0e2e5

View file

@ -91,8 +91,7 @@ export default function (files: Files) {
let acc = Accounts.getFromUsername(body.username) let acc = Accounts.getFromUsername(body.username)
if (acc) { if (acc) {
ServeError(ctx, 400, "account with this username already exists") return ServeError(ctx, 400, "account with this username already exists")
return
} }
if (body.username.length < 3 || body.username.length > 20) { if (body.username.length < 3 || body.username.length > 20) {
@ -110,8 +109,7 @@ export default function (files: Files) {
} }
if (body.password.length < 8) { if (body.password.length < 8) {
ServeError(ctx, 400, "password must be 8 characters or longer") return ServeError(ctx, 400, "password must be 8 characters or longer")
return
} }
return Accounts.create(body.username, body.password) return Accounts.create(body.username, body.password)