-let logjson = (await import('@ndcode/logjson')).default
-
return async env => {
let globals = await env.site.get_json('/_config/globals.json')
let nodemailer_noreply = await env.site.get_nodemailer(
).get(email)
if (
account === undefined ||
- password !== await logjson.logjson_to_json(
- await account.get('password')
- )
+ password !== await account.get_json('password')
)
throw new Problem(
'Unauthorized',
401
)
- if (
- !await logjson.logjson_to_json(
- await account.get('email_verified')
- )
- )
+ if (!await account.get_json('email_verified'))
throw new Problem(
'Email not yet verified',
'Please verify your email address via email link before trying to sign in.',
425
)
- session.set('signed_in_as', transaction.json_to_logjson(email))
-
+ session.set_json('signed_in_as', email)
await transaction.commit()
}
catch (error) {