1 let jst_server = (await import('@ndcode/jst_server')).default
3 return async (env, root) => {
4 let sessions = await root.get('sessions')
5 let session = await sessions.get(env.session_key)
6 if (session === undefined || env.now >= await session.get_json('expires'))
7 // this should never happen, but could happen if we take more than a day
8 // to process an incoming request, and database is cleaned in the meantime
9 throw new jst_server.Problem(
11 'We took too long to process an incoming request, please try again.'