+let jst_server = (await import('@ndcode/jst_server')).default
+
return async env => {
let post_request = await _require('/_lib/post_request.jst')
let get_session = await _require('/_lib/get_session.jst')
- let Problem = await _require('/_lib/Problem.jst')
await post_request(
// env
email = email.slice(0, 256).toLowerCase()
password = password.slice(0, 256)
if (email.length === 0 || password.length < 8)
- throw new Problem(
+ throw new jst_server.Problem(
'Bad request',
'Minimum length check failed',
400
account === undefined ||
password !== await account.get_json('password')
)
- throw new Problem(
+ throw new jst_server.Problem(
'Unauthorized',
'Email and password combination was incorrect.'
401
)
if (!await account.get_json('email_verified'))
- throw new Problem(
+ throw new jst_server.Problem(
'Email not yet verified',
'Please verify your email address via email link before trying to sign in.',
425