Merge branch 'mollersuite:api-v1' into api-v1

This commit is contained in:
cirro 2024-04-29 15:43:46 -04:00 committed by GitHub
commit ef6eb1e4df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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