8 lines
120 B
JavaScript

module.exports = async (ctx, next) => {
if (!ctx.state.user) {
return ctx.unauthorized();
}
await next();
};