let crypto = require('crypto')
-let logjson = (await import('@ndcode/logjson')).default
let XDate = require('xdate')
return async env => {
).get('accounts', {})
).get(env.signed_in_as)
- if (
- old_password !== await logjson.logjson_to_json(
- await account.get('password')
- )
- )
+ if (old_password !== await account.get_json('password'))
throw new Problem(
'Incorrect password',
`Provided old password did not match the expected value.`,
426
)
- await account.set(
- 'password',
- transaction.json_to_logjson(new_password)
- )
-
+ account.set_json('password', new_password)
await transaction.commit()
}
catch (error) {