mirror of
https://github.com/mollersuite/monofile.git
synced 2024-11-21 21:36:26 -08:00
Merge branch 'mollersuite:api-v1' into api-v1
This commit is contained in:
commit
ef6eb1e4df
|
@ -90,8 +90,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) {
|
||||||
|
@ -109,8 +108,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)
|
||||||
|
|
Loading…
Reference in a new issue