post_request(
// env
env,
- // api
+ // endpoint
'/api/sign_up/create_account',
// func
async (verification_code, details) => {
password: details.password.slice(0, 256),
contact_me: details.contact_me ? true : false
}
+ if (
+ verification_code.length < 6 ||
+ details.given_names.length === 0 ||
+ details.password.length < 8
+ )
+ throw new Problem(
+ 'Bad request',
+ 'Minimum length check failed',
+ 400
+ )
let transaction = await env.site.database.Transaction()
try {
if (captcha === undefined || XDate.now() >= captcha.get('expires'))
throw new Problem(
'No verification image in session',
- `Please call the "/api/verification_image.png" endpoint to create a verification image, in same session as the "/api/sign_up.json" call and less than one hour prior.`,
+ `Please call the "/api/verification_image.png" endpoint to create a verification image, in same session as the "/api/sign_up/create_account.json" call and less than one hour prior.`,
418
)