app.use( route.get("/login", async function (context) { const { error, username } = context.request.query; await context.render("login", { error: error != undefined, username, csrf: context.csrf, }); }), );
app.use( route.get("/", async function (context) { await context.render("index", { csrf: context.csrf, username: context.state.user.username, }); }), );
await ctx.render('index.html') } else { await next()